  import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.ArrayList;

import javax.swing.*;

public class BoardUI extends JFrame{
  
  private JFrame frame;
  private ImagePanel panel;
  private JLabel[][] label;
  private JLabel[][] houseLbl;
  private JButton saveButton;
  private Timer gear;
  private Timer goingBackGearTimer;
  
  private ImageIcon token[] = new ImageIcon[8];
  private ImageIcon houseTkn;
  private ImageIcon hotelTkn1, hotelTkn2, hotelTkn3, hotelTkn4;
  private Board b;
  private Block[] block;
  
  private JPanel 	panel_1, panel_2, panel_3, panel_4, panel_5, panel_6, panel_7,
  					panel_8, panel_9, panel_10, panel_11, panel_12, panel_13,
  					panel_14, panel_15, panel_16, panel_17, panel_18, panel_19,
  					panel_20, panel_21, panel_22, panel_23, panel_24, panel_25,
  					panel_26, panel_27, panel_28, panel_29, panel_30, panel_31,
  					panel_32, panel_33, panel_34, panel_35, panel_36, panel_37,
  					panel_38, panel_39, panel_40, panel_41;
  
  private int limit;
  private Boolean lastManStanding = false;
  
  private PlayerSelectionUI playerSelect;
  private PropertySelectionUI propertySelectionUI;
  private DiceUI diceui;
  private GodDiceUI godDice;
  private TradeUI tradeUI;
  private AuctionUI auctionUI;
  private boolean loaded = false;
  
  private static BoardUI singleBoardUI;
  
  protected BoardUI(Player[] play){
	  	
	  	if(play.length == 1 && play[0].getPlayerName() != "Tester"){
	  		this.loaded = true;
	  	}
	  	this.b = new Board(play);
	  	this.block = this.b.getBlkArray();
	  	this.label = new JLabel[8][41];
	  	this.houseLbl = new JLabel[22][5];
	  	
	  	
	  	for(int numOfPlayers = 0; numOfPlayers<b.getP().length; numOfPlayers++){
		  	token[numOfPlayers]=new ImageIcon(b.getP()[numOfPlayers].getPlayerToken());
		  	if(!loaded){
		  		this.b.getP()[numOfPlayers].setCurrentBlockPos(block[0]);
		  	}
	  	}
	  	
	  	this.houseTkn = new ImageIcon("Graphics/house.png");
	  	this.hotelTkn1= new ImageIcon("Graphics/hotel1.png");
	  	this.hotelTkn2= new ImageIcon("Graphics/hotel2.png");
	  	this.hotelTkn3= new ImageIcon("Graphics/hotel3.png");
	  	this.hotelTkn4= new ImageIcon("Graphics/hotel4.png");
	  	
	  	frame = new JFrame();
	  	panel = new ImagePanel(new ImageIcon("Graphics/BoardDraft3.jpg").getImage());   
		frame.getContentPane().add(panel, BorderLayout.SOUTH);
		frame.setDefaultCloseOperation(EXIT_ON_CLOSE);
		
		panel_1 = new JPanel();
		panel_1.setBounds(727, 518, 65, 82);
		panel.add(panel_1);
		panel_1.setLayout(null);
		panel_1.setOpaque(false);
			
		panel_2 = new JPanel();
		panel_2.setLayout(null);
		panel_2.setOpaque(false);
		panel_2.setBounds(628, 518, 65, 82);
		panel.add(panel_2);
		
		panel_3 = new JPanel();
		panel_3.setLayout(null);
		panel_3.setOpaque(false);
		panel_3.setBounds(563, 518, 65, 82);
		panel.add(panel_3);
				
		panel_4 = new JPanel();
		panel_4.setLayout(null);
		panel_4.setOpaque(false);
		panel_4.setBounds(497, 518, 65, 82);
		panel.add(panel_4);
		
		panel_5 = new JPanel();
		panel_5.setLayout(null);
		panel_5.setOpaque(false);
		panel_5.setBounds(432, 518, 65, 82);
		panel.add(panel_5);
		
		panel_6 = new JPanel();
		panel_6.setLayout(null);
		panel_6.setOpaque(false);
		panel_6.setBounds(367, 518, 65, 82);
		panel.add(panel_6);
		
		panel_7 = new JPanel();
		panel_7.setLayout(null);
		panel_7.setOpaque(false);
		panel_7.setBounds(300, 518, 65, 82);
		panel.add(panel_7);
		
		panel_8 = new JPanel();
		panel_8.setLayout(null);
		panel_8.setOpaque(false);
		panel_8.setBounds(234, 518, 65, 82);
		panel.add(panel_8);		
		
		panel_9 = new JPanel();
		panel_9.setLayout(null);
		panel_9.setOpaque(false);
		panel_9.setBounds(169, 518, 65, 82);
		panel.add(panel_9);			
		
		panel_10 = new JPanel();
		panel_10.setLayout(null);
		panel_10.setOpaque(false);
		panel_10.setBounds(103, 518, 65, 82);
		panel.add(panel_10);	
		
		panel_11 = new JPanel();
		panel_11.setLayout(null);
		panel_11.setOpaque(false);
		panel_11.setBounds(0, 518, 101, 82);
		panel.add(panel_11);
		
		panel_41 = new JPanel();
		panel_41.setLayout(null);
		panel_41.setOpaque(false);
		panel_41.setBounds(26, 518, 75, 57);
		panel.add(panel_41);
		
		panel_12 = new JPanel();
		panel_12.setLayout(null);
		panel_12.setOpaque(false);
		panel_12.setBounds(0, 469, 101, 49);
		panel.add(panel_12);
				
		panel_13 = new JPanel();
		panel_13.setLayout(null);
		panel_13.setOpaque(false);
		panel_13.setBounds(0, 421, 101, 49);
		panel.add(panel_13);
				
		panel_14 = new JPanel();
		panel_14.setLayout(null);
		panel_14.setOpaque(false);
		panel_14.setBounds(0, 373, 101, 49);
		panel.add(panel_14);
		
		panel_15 = new JPanel();
		panel_15.setLayout(null);
		panel_15.setOpaque(false);
		panel_15.setBounds(0, 323, 101, 49);
		panel.add(panel_15);
		
		panel_16 = new JPanel();
		panel_16.setLayout(null);
		panel_16.setOpaque(false);
		panel_16.setBounds(0, 276, 101, 49);
		panel.add(panel_16);
		
		panel_17 = new JPanel();
		panel_17.setLayout(null);
		panel_17.setOpaque(false);
		panel_17.setBounds(0, 227, 101, 49);
		panel.add(panel_17);
			
		panel_18 = new JPanel();
		panel_18.setLayout(null);
		panel_18.setOpaque(false);
		panel_18.setBounds(0, 179, 101, 49);
		panel.add(panel_18);	
		
		panel_19 = new JPanel();
		panel_19.setLayout(null);
		panel_19.setOpaque(false);
		panel_19.setBounds(0, 130, 101, 49);
		panel.add(panel_19);
			
		panel_20 = new JPanel();
		panel_20.setLayout(null);
		panel_20.setOpaque(false);
		panel_20.setBounds(0, 80, 101, 49);
		panel.add(panel_20);
		
		panel_21 = new JPanel();
		panel_21.setLayout(null);
		panel_21.setOpaque(false);
		panel_21.setBounds(0, 20, 101, 49);
		panel.add(panel_21);
		
		panel_22 = new JPanel();
		panel_22.setLayout(null);
		panel_22.setOpaque(false);
		panel_22.setBounds(106, 0, 65, 82);
		panel.add(panel_22);
			
		panel_23 = new JPanel();
		panel_23.setLayout(null);
		panel_23.setOpaque(false);
		panel_23.setBounds(169, 0, 65, 82);
		panel.add(panel_23);
		
		panel_24 = new JPanel();
		panel_24.setLayout(null);
		panel_24.setOpaque(false);
		panel_24.setBounds(234, 0, 65, 82);
		panel.add(panel_24);
		
		panel_25 = new JPanel();
		panel_25.setLayout(null);
		panel_25.setOpaque(false);
		panel_25.setBounds(300, 0, 65, 82);
		panel.add(panel_25);
			
		panel_26 = new JPanel();
		panel_26.setLayout(null);
		panel_26.setOpaque(false);
		panel_26.setBounds(367, 0, 65, 82);
		panel.add(panel_26);
		
		panel_27 = new JPanel();
		panel_27.setLayout(null);
		panel_27.setOpaque(false);
		panel_27.setBounds(432, 0, 65, 82);
		panel.add(panel_27);
		
		panel_28 = new JPanel();
		panel_28.setLayout(null);
		panel_28.setOpaque(false);
		panel_28.setBounds(497, 0, 65, 82);
		panel.add(panel_28);
			
		panel_29 = new JPanel();
		panel_29.setLayout(null);
		panel_29.setOpaque(false);
		panel_29.setBounds(567, 0, 65, 82);
		panel.add(panel_29);
			
		panel_30 = new JPanel();
		panel_30.setLayout(null);
		panel_30.setOpaque(false);
		panel_30.setBounds(630, 0, 65, 82);
		panel.add(panel_30);
		
		panel_31 = new JPanel();
		panel_31.setLayout(null);
		panel_31.setOpaque(false);
		panel_31.setBounds(703, 20, 101, 49);
		panel.add(panel_31);
			
		panel_32 = new JPanel();
		panel_32.setLayout(null);
		panel_32.setOpaque(false);
		panel_32.setBounds(694, 80, 101, 49);
		panel.add(panel_32);
			
		panel_33 = new JPanel();
		panel_33.setLayout(null);
		panel_33.setOpaque(false);
		panel_33.setBounds(694, 130, 101, 49);
		panel.add(panel_33);
		
		panel_34 = new JPanel();
		panel_34.setLayout(null);
		panel_34.setOpaque(false);
		panel_34.setBounds(694, 179, 101, 49);
		panel.add(panel_34);
			
		panel_35 = new JPanel();
		panel_35.setLayout(null);
		panel_35.setOpaque(false);
		panel_35.setBounds(694, 227, 101, 49);
		panel.add(panel_35);
		
		panel_36 = new JPanel();
		panel_36.setLayout(null);
		panel_36.setOpaque(false);
		panel_36.setBounds(694, 276, 101, 49);
		panel.add(panel_36);
		
		panel_37 = new JPanel();
		panel_37.setLayout(null);
		panel_37.setOpaque(false);
		panel_37.setBounds(694, 323, 101, 49);
		panel.add(panel_37);
		
		panel_38 = new JPanel();
		panel_38.setLayout(null);
		panel_38.setOpaque(false);
		panel_38.setBounds(694, 373, 101, 49);
		panel.add(panel_38);
			
		panel_39 = new JPanel();
		panel_39.setLayout(null);
		panel_39.setOpaque(false);
		panel_39.setBounds(694, 421, 101, 49);
		panel.add(panel_39);
		
		panel_40 = new JPanel();
		panel_40.setLayout(null);
		panel_40.setOpaque(false);
		panel_40.setBounds(694, 469, 101, 49);
		panel.add(panel_40);

		
		for(int counter=0; counter<b.getP().length;counter++){
			initializePlayerIcons(counter);
		}
		
		reinitializeIcons();//this is to make sure tokens are in the right place(loading)
		
		initializeHouseIcons();
		
		reinitializeHouseIcons();
		
		frame.setSize(800,600);		
		frame.pack();
		frame.setResizable(false);
		frame.setVisible(true);
		 
		playerSelect = new PlayerSelectionUI(b.getCurrentPlayer());
		
		this.saveButton = new JButton(new ImageIcon("Graphics/Mascot.png"));
		this.saveButton.setToolTipText("SaveGame");
		this.saveButton.setBorderPainted(false);
		this.saveButton.setContentAreaFilled(false);
		panel.add(this.saveButton);
		this.saveButton.setBounds(335, 240, 114, 139);
		this.saveButton.setCursor(new Cursor(Cursor.HAND_CURSOR));
		this.saveButton.setRolloverEnabled(true);
		this.saveButton.setRolloverIcon(new ImageIcon("Graphics/MascotRollOver.png"));
		this.saveButton.addActionListener(new ActionListener(){

			@Override
			public void actionPerformed(ActionEvent e) {
				new SaveUI();
				
			}
			
		});
		
		
		
  }

 

public static BoardUI getInstance(Player[] play){
	  if(singleBoardUI==null){
		  singleBoardUI=new BoardUI(play);
	  }
	  
	  return singleBoardUI;
  }
  
  public static BoardUI getInstance(){
	  return singleBoardUI;
  }
  
  private void reinitializeIcons() {
		
	  	for(int counter = 0; counter<this.b.getP().length; counter++){
	  		
	  		this.label[counter][0].setVisible(false);
	  		this.label[counter][this.b.getP()[counter].getCurrentBlockPos().getBlockNumber()].setVisible(true);
	  		
	  	}
		
	}
  
  public void initializePlayerIcons(int playNum){
	  
	  switch(playNum){
	  	case 0: 
	  			label[0][0] = new JLabel(token[0]);
				label[0][0].setBounds(4, 24, 11, 24);
				label[0][0].setVisible(true);
				panel_1.add(label[0][0]);
	  			
				label[0][1] = new JLabel(token[0]);
				label[0][1].setBounds(4, 24, 11, 20);
				label[0][1].setVisible(false);
				panel_2.add(label[0][1]);
				
				label[0][2] = new JLabel(token[0]);
				label[0][2].setBounds(4, 24, 11, 20);
				label[0][2].setVisible(false);
				panel_3.add(label[0][2]);
				
				label[0][3] = new JLabel(token[0]);
				label[0][3].setBounds(4, 24, 11, 20);
				label[0][3].setVisible(false);
				panel_4.add(label[0][3]);
				
				label[0][4] = new JLabel(token[0]);
				label[0][4].setBounds(4, 24, 11, 20);
				label[0][4].setVisible(false);
				panel_5.add(label[0][4]);
				
				label[0][5] = new JLabel(token[0]);
				label[0][5].setBounds(4, 24, 11, 20);
				label[0][5].setVisible(false);
				panel_6.add(label[0][5]);
				
				label[0][6] = new JLabel(token[0]);
				label[0][6].setBounds(4, 24, 11, 20);
				label[0][6].setVisible(false);
				panel_7.add(label[0][6]);

				label[0][7] = new JLabel(token[0]);
				label[0][7].setBounds(4, 24, 11, 20);
				label[0][7].setVisible(false);
				panel_8.add(label[0][7]);
				
				label[0][8] = new JLabel(token[0]);
				label[0][8].setBounds(4, 24, 11, 20);
				label[0][8].setVisible(false);
				panel_9.add(label[0][8]);
				
				label[0][9] = new JLabel(token[0]);
				label[0][9].setBounds(4, 24, 11, 20);
				label[0][9].setVisible(false);
				panel_10.add(label[0][9]);
				
				label[0][10] = new JLabel(token[0]);
				label[0][10].setBounds(4, 4, 11, 20);
				label[0][10].setVisible(false);
				panel_11.add(label[0][10]);
				
				label[0][11] = new JLabel(token[0]);
				label[0][11].setBounds(6, 2, 11, 20);
				label[0][11].setVisible(false);
				panel_12.add(label[0][11]);
				
				label[0][12] = new JLabel(token[0]);
				label[0][12].setBounds(6, 2, 11, 20);
				label[0][12].setVisible(false);
				panel_13.add(label[0][12]);
				
				label[0][13] = new JLabel(token[0]);
				label[0][13].setBounds(6, 2, 11, 20);
				label[0][13].setVisible(false);
				panel_14.add(label[0][13]);
				
				label[0][14] = new JLabel(token[0]);
				label[0][14].setBounds(6, 2, 11, 20);
				label[0][14].setVisible(false);
				panel_15.add(label[0][14]);
				
				label[0][15] = new JLabel(token[0]);
				label[0][15].setBounds(6, 2, 11, 20);
				label[0][15].setVisible(false);
				panel_16.add(label[0][15]);
				
				label[0][16] = new JLabel(token[0]);
				label[0][16].setBounds(6, 2, 11, 20);
				label[0][16].setVisible(false);
				panel_17.add(label[0][16]);
				
				label[0][17] = new JLabel(token[0]);
				label[0][17].setBounds(6, 2, 11, 20);
				label[0][17].setVisible(false);
				panel_18.add(label[0][17]);
				
				label[0][18] = new JLabel(token[0]);
				label[0][18].setBounds(6, 2, 11, 20);
				label[0][18].setVisible(false);
				panel_19.add(label[0][18]);
				
				label[0][19] = new JLabel(token[0]);
				label[0][19].setBounds(6, 2, 11, 20);
				label[0][19].setVisible(false);
				panel_20.add(label[0][19]);
				
				label[0][20] = new JLabel(token[0]);
				label[0][20].setBounds(6, 2, 11, 20);
				label[0][20].setVisible(false);
				panel_21.add(label[0][20]);
				
				label[0][21] = new JLabel(token[0]);
				label[0][21].setBounds(4, 8, 11, 20);
				label[0][21].setVisible(false);
				panel_22.add(label[0][21]);
				
				label[0][22] = new JLabel(token[0]);
				label[0][22].setBounds(4, 8, 11, 20);
				label[0][22].setVisible(false);
				panel_23.add(label[0][22]);
				
				label[0][23] = new JLabel(token[0]);
				label[0][23].setBounds(4, 8, 11, 20);
				label[0][23].setVisible(false);
				panel_24.add(label[0][23]);
				
				label[0][24] = new JLabel(token[0]);
				label[0][24].setBounds(4, 8, 11, 20);
				label[0][24].setVisible(false);
				panel_25.add(label[0][24]);
			
				label[0][25] = new JLabel(token[0]);
				label[0][25].setBounds(4, 8, 11, 20);
				label[0][25].setVisible(false);
				panel_26.add(label[0][25]);
				
				label[0][26] = new JLabel(token[0]);
				label[0][26].setBounds(4, 8, 11, 20);
				label[0][26].setVisible(false);
				panel_27.add(label[0][26]);
				
				label[0][27] = new JLabel(token[0]);
				label[0][27].setBounds(4, 8, 11, 20);
				label[0][27].setVisible(false);
				panel_28.add(label[0][27]);
				
				label[0][28] = new JLabel(token[0]);
				label[0][28].setBounds(4, 8, 11, 20);
				label[0][28].setVisible(false);
				panel_29.add(label[0][28]);
				
				label[0][29] = new JLabel(token[0]);
				label[0][29].setBounds(4, 8, 11, 20);
				label[0][29].setVisible(false);
				panel_30.add(label[0][29]);
				
				label[0][30] = new JLabel(token[0]);
				label[0][30].setBounds(6, 2, 11, 20);
				label[0][30].setVisible(false);
				panel_31.add(label[0][30]);
				
				label[0][31] = new JLabel(token[0]);
				label[0][31].setBounds(37, 2, 11, 20);
				label[0][31].setVisible(false);
				panel_32.add(label[0][31]);
				

				label[0][32] = new JLabel(token[0]);
				label[0][32].setBounds(37, 2, 11, 20);
				label[0][32].setVisible(false);
				panel_33.add(label[0][32]);
				
				label[0][33] = new JLabel(token[0]);
				label[0][33].setBounds(37, 2, 11, 20);
				label[0][33].setVisible(false);
				panel_34.add(label[0][33]);
				
				label[0][34] = new JLabel(token[0]);
				label[0][34].setBounds(37, 2, 11, 20);
				label[0][34].setVisible(false);
				panel_35.add(label[0][34]);
				
				label[0][35] = new JLabel(token[0]);
				label[0][35].setBounds(37, 2, 11, 20);
				label[0][35].setVisible(false);
				panel_36.add(label[0][35]);
				
				label[0][36] = new JLabel(token[0]);
				label[0][36].setBounds(37, 2, 11, 20);
				label[0][36].setVisible(false);
				panel_37.add(label[0][36]);
				
				label[0][37] = new JLabel(token[0]);
				label[0][37].setBounds(37, 2, 11, 20);
				label[0][37].setVisible(false);
				panel_38.add(label[0][37]);
				
				label[0][38] = new JLabel(token[0]);
				label[0][38].setBounds(37, 2, 11, 20);
				label[0][38].setVisible(false);
				panel_39.add(label[0][38]);
				
				label[0][39] = new JLabel(token[0]);
				label[0][39].setBounds(37, 2, 11, 20);
				label[0][39].setVisible(false);
				panel_40.add(label[0][39]);
				
				label[0][40] = new JLabel(token[0]);
				label[0][40].setBounds(37, 2, 11, 20);
				label[0][40].setVisible(false);
				panel_41.add(label[0][40]);
				
				break;
				
	  	case 1:
				label[1][0] = new JLabel(token[1]);
				label[1][0].setBounds(19, 24, 11, 20);
				label[1][0].setVisible(true);
				panel_1.add(label[1][0]);
				
				label[1][1] = new JLabel(token[1]);
				label[1][1].setBounds(19, 24, 11, 20);
				label[1][1].setVisible(false);
				panel_2.add(label[1][1]);
				
				label[1][2] = new JLabel(token[1]);
				label[1][2].setBounds(19, 24, 11, 20);
				label[1][2].setVisible(false);
				panel_3.add(label[1][2]);
				
				label[1][3] = new JLabel(token[1]);
				label[1][3].setBounds(19, 24, 11, 20);
				label[1][3].setVisible(false);
				panel_4.add(label[1][3]);
				
				label[1][4] = new JLabel(token[1]);
				label[1][4].setBounds(19, 24, 11, 20);
				label[1][4].setVisible(false);
				panel_5.add(label[1][4]);
				
				label[1][5] = new JLabel(token[1]);
				label[1][5].setBounds(19, 24, 11, 20);
				label[1][5].setVisible(false);
				panel_6.add(label[1][5]);
				
				label[1][6] = new JLabel(token[1]);
				label[1][6].setBounds(19, 24, 11, 20);
				label[1][6].setVisible(false);
				panel_7.add(label[1][6]);
				
				label[1][7] = new JLabel(token[1]);
				label[1][7].setBounds(19, 24, 11, 20);
				label[1][7].setVisible(false);
				panel_8.add(label[1][7]);
				
				label[1][8] = new JLabel(token[1]);
				label[1][8].setBounds(19, 24, 11, 20);
				label[1][8].setVisible(false);
				panel_9.add(label[1][8]);
				
				label[1][9] = new JLabel(token[1]);
				label[1][9].setBounds(19, 24, 11, 20);
				label[1][9].setVisible(false);
				panel_10.add(label[1][9]);
				
				label[1][10] = new JLabel(token[1]);
				label[1][10].setBounds(4, 31, 11, 20);
				label[1][10].setVisible(false);
				panel_11.add(label[1][10]);
				
				label[1][11] = new JLabel(token[1]);
				label[1][11].setBounds(21, 2, 11, 20);
				label[1][11].setVisible(false);
				panel_12.add(label[1][11]);
				
				label[1][12] = new JLabel(token[1]);
				label[1][12].setBounds(21, 2, 11, 20);
				label[1][12].setVisible(false);
				panel_13.add(label[1][12]);
				
				label[1][13] = new JLabel(token[1]);
				label[1][13].setBounds(21, 2, 11, 20);
				label[1][13].setVisible(false);
				panel_14.add(label[1][13]);
				
				label[1][14] = new JLabel(token[1]);
				label[1][14].setBounds(21, 2, 11, 20);
				label[1][14].setVisible(false);
				panel_15.add(label[1][14]);
				
				label[1][15] = new JLabel(token[1]);
				label[1][15].setBounds(21, 2, 11, 20);
				label[1][15].setVisible(false);
				panel_16.add(label[1][15]);
				
				label[1][16] = new JLabel(token[1]);
				label[1][16].setBounds(21, 2, 11, 20);
				label[1][16].setVisible(false);
				panel_17.add(label[1][16]);
				
				label[1][17] = new JLabel(token[1]);
				label[1][17].setBounds(21, 2, 11, 20);
				label[1][17].setVisible(false);
				panel_18.add(label[1][17]);
				
				label[1][18] = new JLabel(token[1]);
				label[1][18].setBounds(21, 2, 11, 20);
				label[1][18].setVisible(false);
				panel_19.add(label[1][18]);
				
				label[1][19] = new JLabel(token[1]);
				label[1][19].setBounds(21, 2, 11, 20);
				label[1][19].setVisible(false);
				panel_20.add(label[1][19]);
				
				label[1][20] = new JLabel(token[1]);
				label[1][20].setBounds(21, 2, 11, 20);
				label[1][20].setVisible(false);
				panel_21.add(label[1][20]);
				
				label[1][21] = new JLabel(token[1]);
				label[1][21].setBounds(19, 8, 11, 20);
				label[1][21].setVisible(false);
				panel_22.add(label[1][21]);
				
				label[1][22] = new JLabel(token[1]);
				label[1][22].setBounds(19, 8, 11, 20);
				label[1][22].setVisible(false);
				panel_23.add(label[1][22]);
				
				label[1][23] = new JLabel(token[1]);
				label[1][23].setBounds(19, 8, 11, 20);
				label[1][23].setVisible(false);
				panel_24.add(label[1][23]);
				
				label[1][24] = new JLabel(token[1]);
				label[1][24].setBounds(19, 8, 11, 20);
				label[1][24].setVisible(false);
				panel_25.add(label[1][24]);
				
				label[1][25] = new JLabel(token[1]);
				label[1][25].setBounds(19, 8, 11, 20);
				label[1][25].setVisible(false);
				panel_26.add(label[1][25]);
				
				label[1][26] = new JLabel(token[1]);
				label[1][26].setBounds(19, 8, 11, 20);
				label[1][26].setVisible(false);
				panel_27.add(label[1][26]);
				
				label[1][27] = new JLabel(token[1]);
				label[1][27].setBounds(19, 8, 11, 20);
				label[1][27].setVisible(false);
				panel_28.add(label[1][27]);
				
				label[1][28] = new JLabel(token[1]);
				label[1][28].setBounds(19, 8, 11, 20);
				label[1][28].setVisible(false);
				panel_29.add(label[1][28]);
				
				label[1][29] = new JLabel(token[1]);
				label[1][29].setBounds(19, 8, 11, 20);
				label[1][29].setVisible(false);
				panel_30.add(label[1][29]);
				
				label[1][30] = new JLabel(token[1]);
				label[1][30].setBounds(21, 2, 11, 20);
				label[1][30].setVisible(false);
				panel_31.add(label[1][30]);
				
				label[1][31] = new JLabel(token[1]);
				label[1][31].setBounds(52, 2, 11, 20);
				label[1][31].setVisible(false);
				panel_32.add(label[1][31]);
			
				label[1][32] = new JLabel(token[1]);
				label[1][32].setBounds(52, 2, 11, 20);
				label[1][32].setVisible(false);
				panel_33.add(label[1][32]);
				
				label[1][33] = new JLabel(token[1]);
				label[1][33].setBounds(52, 2, 11, 20);
				label[1][33].setVisible(false);
				panel_34.add(label[1][33]);
				
				label[1][34] = new JLabel(token[1]);
				label[1][34].setBounds(52, 2, 11, 20);
				label[1][34].setVisible(false);
				panel_35.add(label[1][34]);
				
				label[1][35] = new JLabel(token[1]);
				label[1][35].setBounds(52, 2, 11, 20);
				label[1][35].setVisible(false);
				panel_36.add(label[1][35]);
				
				label[1][36] = new JLabel(token[1]);
				label[1][36].setBounds(52, 2, 11, 20);
				label[1][36].setVisible(false);
				panel_37.add(label[1][36]);
				
				label[1][37] = new JLabel(token[1]);
				label[1][37].setBounds(52, 2, 11, 20);
				label[1][37].setVisible(false);
				panel_38.add(label[1][37]);
				
				label[1][38] = new JLabel(token[1]);
				label[1][38].setBounds(52, 2, 11, 20);
				label[1][38].setVisible(false);
				panel_39.add(label[1][38]);
				
				label[1][39] = new JLabel(token[1]);
				label[1][39].setBounds(52, 2, 11, 20);
				label[1][39].setVisible(false);
				panel_40.add(label[1][39]);
				
				label[1][40] = new JLabel(token[1]);
				label[1][40].setBounds(52, 2, 11, 20);
				label[1][40].setVisible(false);
				panel_41.add(label[1][40]);
		  		
	  			break;
	  			
	  	case 2:
				label[2][0] = new JLabel(token[2]);
				label[2][0].setBounds(35, 24, 11, 20);
				label[2][0].setVisible(true);
				panel_1.add(label[2][0]);
				
				label[2][1] = new JLabel(token[2]);
				label[2][1].setBounds(35, 24, 11, 20);
				label[2][1].setVisible(false);
				panel_2.add(label[2][1]);
				
				label[2][2] = new JLabel(token[2]);
				label[2][2].setBounds(35, 24, 11, 20);
				label[2][2].setVisible(false);
				panel_3.add(label[2][2]);
				
				label[2][3] = new JLabel(token[2]);
				label[2][3].setBounds(35, 24, 11, 20);
				label[2][3].setVisible(false);
				panel_4.add(label[2][3]);
				
				label[2][4] = new JLabel(token[2]);
				label[2][4].setBounds(35, 24, 11, 20);
				label[2][4].setVisible(false);
				panel_5.add(label[2][4]);
				
				label[2][5] = new JLabel(token[2]);
				label[2][5].setBounds(35, 24, 11, 20);
				label[2][5].setVisible(false);
				panel_6.add(label[2][5]);
				
				label[2][6] = new JLabel(token[2]);
				label[2][6].setBounds(35, 24, 11, 20);
				label[2][6].setVisible(false);
				panel_7.add(label[2][6]);
				
				label[2][7] = new JLabel(token[2]);
				label[2][7].setBounds(35, 24, 11, 20);
				label[2][7].setVisible(false);
				panel_8.add(label[2][7]);
				
				label[2][8] = new JLabel(token[2]);
				label[2][8].setBounds(35, 24, 11, 20);
				label[2][8].setVisible(false);
				panel_9.add(label[2][8]);
				
				label[2][9] = new JLabel(token[2]);
				label[2][9].setBounds(35, 24, 11, 20);
				label[2][9].setVisible(false);
				panel_10.add(label[2][9]);
				
				label[2][10] = new JLabel(token[2]);
				label[2][10].setBounds(4, 58, 11, 20);
				label[2][10].setVisible(false);
				panel_11.add(label[2][10]);
				
				label[2][11] = new JLabel(token[2]);
				label[2][11].setBounds(37, 2, 11, 20);
				label[2][11].setVisible(false);
				panel_12.add(label[2][11]);
				
				label[2][12] = new JLabel(token[2]);
				label[2][12].setBounds(37, 2, 11, 20);
				label[2][12].setVisible(false);
				panel_13.add(label[2][12]);
				
				label[2][13] = new JLabel(token[2]);
				label[2][13].setBounds(37, 2, 11, 20);
				label[2][13].setVisible(false);
				panel_14.add(label[2][13]);
				
				label[2][14] = new JLabel(token[2]);
				label[2][14].setBounds(37, 2, 11, 20);
				label[2][14].setVisible(false);
				panel_15.add(label[2][14]);
				
				label[2][15] = new JLabel(token[2]);
				label[2][15].setBounds(37, 2, 11, 20);
				label[2][15].setVisible(false);
				panel_16.add(label[2][15]);
	
				label[2][16] = new JLabel(token[2]);
				label[2][16].setBounds(37, 2, 11, 20);
				label[2][16].setVisible(false);
				panel_17.add(label[2][16]);
				
				label[2][17] = new JLabel(token[2]);
				label[2][17].setBounds(37, 2, 11, 20);
				label[2][17].setVisible(false);
				panel_18.add(label[2][17]);
				
				label[2][18] = new JLabel(token[2]);
				label[2][18].setBounds(37, 2, 11, 20);
				label[2][18].setVisible(false);
				panel_19.add(label[2][18]);
				
				label[2][19] = new JLabel(token[2]);
				label[2][19].setBounds(37, 2, 11, 20);
				label[2][19].setVisible(false);
				panel_20.add(label[2][19]);
			
				label[2][20] = new JLabel(token[2]);
				label[2][20].setBounds(37, 2, 11, 20);
				label[2][20].setVisible(false);
				panel_21.add(label[2][20]);
				
				label[2][21] = new JLabel(token[2]);
				label[2][21].setBounds(35, 8, 11, 20);
				label[2][21].setVisible(false);
				panel_22.add(label[2][21]);
				
				label[2][22] = new JLabel(token[2]);
				label[2][22].setBounds(35, 8, 11, 20);
				label[2][22].setVisible(false);
				panel_23.add(label[2][22]);
				
				label[2][23] = new JLabel(token[2]);
				label[2][23].setBounds(35, 8, 11, 20);
				label[2][23].setVisible(false);
				panel_24.add(label[2][23]);
				
				label[2][24] = new JLabel(token[2]);
				label[2][24].setBounds(35, 8, 11, 20);
				label[2][24].setVisible(false);
				panel_25.add(label[2][24]);
				
				label[2][25] = new JLabel(token[2]);
				label[2][25].setBounds(35, 8, 11, 20);
				label[2][25].setVisible(false);
				panel_26.add(label[2][25]);
				
				label[2][26] = new JLabel(token[2]);
				label[2][26].setBounds(35, 8, 11, 20);
				label[2][26].setVisible(false);
				panel_27.add(label[2][26]);
				
				label[2][27] = new JLabel(token[2]);
				label[2][27].setBounds(35, 8, 11, 20);
				label[2][27].setVisible(false);
				panel_28.add(label[2][27]);
				
				label[2][28] = new JLabel(token[2]);
				label[2][28].setBounds(35, 8, 11, 20);
				label[2][28].setVisible(false);
				panel_29.add(label[2][28]);
				
				label[2][29] = new JLabel(token[2]);
				label[2][29].setBounds(35, 8, 11, 20);
				label[2][29].setVisible(false);
				panel_30.add(label[2][29]);
				
				label[2][30] = new JLabel(token[2]);
				label[2][30].setBounds(37, 2, 11, 20);
				label[2][30].setVisible(false);
				panel_31.add(label[2][30]);
				
				label[2][31] = new JLabel(token[2]);
				label[2][31].setBounds(67, 2, 11, 20);
				label[2][31].setVisible(false);
				panel_32.add(label[2][31]);
				
				label[2][32] = new JLabel(token[2]);
				label[2][32].setBounds(67, 2, 11, 20);
				label[2][32].setVisible(false);
				panel_33.add(label[2][32]);
				
				label[2][33] = new JLabel(token[2]);
				label[2][33].setBounds(67, 2, 11, 20);
				label[2][33].setVisible(false);
				panel_34.add(label[2][33]);
				
				label[2][34] = new JLabel(token[2]);
				label[2][34].setBounds(67, 2, 11, 20);
				label[2][34].setVisible(false);
				panel_35.add(label[2][34]);
				
				label[2][35] = new JLabel(token[2]);
				label[2][35].setBounds(67, 2, 11, 20);
				label[2][35].setVisible(false);
				panel_36.add(label[2][35]);
				
				label[2][36] = new JLabel(token[2]);
				label[2][36].setBounds(67, 2, 11, 20);
				label[2][36].setVisible(false);
				panel_37.add(label[2][36]);
				
				label[2][37] = new JLabel(token[2]);
				label[2][37].setBounds(67, 2, 11, 20);
				label[2][37].setVisible(false);
				panel_38.add(label[2][37]);
				
				label[2][38] = new JLabel(token[2]);
				label[2][38].setBounds(67, 2, 11, 20);
				label[2][38].setVisible(false);
				panel_39.add(label[2][38]);
				
				label[2][39] = new JLabel(token[2]);
				label[2][39].setBounds(67, 2, 11, 20);
				label[2][39].setVisible(false);
				panel_40.add(label[2][39]);
				
				label[2][40] = new JLabel(token[2]);
				label[2][40].setBounds(67, 2, 11, 20);
				label[2][40].setVisible(false);
				panel_41.add(label[2][40]);
				
				
				
	  			break;
	  			
	  	case 3:
		  		label[3][0] = new JLabel(token[3]);
				label[3][0].setBounds(50, 24, 11, 20);
				label[3][0].setVisible(true);
				panel_1.add(label[3][0]);
				
				label[3][1] = new JLabel(token[3]);
				label[3][1].setBounds(50, 24, 11, 20);
				label[3][1].setVisible(false);
				panel_2.add(label[3][1]);
				
				label[3][2] = new JLabel(token[3]);
				label[3][2].setBounds(50, 24, 11, 20);
				label[3][2].setVisible(false);
				panel_3.add(label[3][2]);
				
				label[3][3] = new JLabel(token[3]);
				label[3][3].setBounds(50, 24, 11, 20);
				label[3][3].setVisible(false);
				panel_4.add(label[3][3]);
				
				label[3][4] = new JLabel(token[3]);
				label[3][4].setBounds(50, 24, 11, 20);
				label[3][4].setVisible(false);
				panel_5.add(label[3][4]);
				
				label[3][5] = new JLabel(token[3]);
				label[3][5].setBounds(50, 24, 11, 20);
				label[3][5].setVisible(false);
				panel_6.add(label[3][5]);
				
				label[3][6] = new JLabel(token[3]);
				label[3][6].setBounds(50, 24, 11, 20);
				label[3][6].setVisible(false);
				panel_7.add(label[3][6]);
				
				label[3][7] = new JLabel(token[3]);
				label[3][7].setBounds(50, 24, 11, 20);
				label[3][7].setVisible(false);
				panel_8.add(label[3][7]);
				
				label[3][8] = new JLabel(token[3]);
				label[3][8].setBounds(50, 24, 11, 20);
				label[3][8].setVisible(false);
				panel_9.add(label[3][8]);
				
				label[3][9] = new JLabel(token[3]);
				label[3][9].setBounds(50, 24, 11, 20);
				label[3][9].setVisible(false);
				panel_10.add(label[3][9]);
				
				label[3][10] = new JLabel(token[3]);
				label[3][10].setBounds(20, 58, 11, 20);
				label[3][10].setVisible(false);
				panel_11.add(label[3][10]);
				
				label[3][11] = new JLabel(token[3]);
				label[3][11].setBounds(52, 2, 11, 20);
				label[3][11].setVisible(false);
				panel_12.add(label[3][11]);
				
				label[3][12] = new JLabel(token[3]);
				label[3][12].setBounds(52, 2, 11, 20);
				label[3][12].setVisible(false);
				panel_13.add(label[3][12]);
				
				label[3][13] = new JLabel(token[3]);
				label[3][13].setBounds(52, 2, 11, 20);
				label[3][13].setVisible(false);
				panel_14.add(label[3][13]);
				
				label[3][14] = new JLabel(token[3]);
				label[3][14].setBounds(52, 2, 11, 20);
				label[3][14].setVisible(false);
				panel_15.add(label[3][14]);
				
				label[3][15] = new JLabel(token[3]);
				label[3][15].setBounds(52, 2, 11, 20);
				label[3][15].setVisible(false);
				panel_16.add(label[3][15]);
				
				label[3][16] = new JLabel(token[3]);
				label[3][16].setBounds(52, 2, 11, 20);
				label[3][16].setVisible(false);
				panel_17.add(label[3][16]);
				
				label[3][17] = new JLabel(token[3]);
				label[3][17].setBounds(52, 2, 11, 20);
				label[3][17].setVisible(false);
				panel_18.add(label[3][17]);
				
				label[3][18] = new JLabel(token[3]);
				label[3][18].setBounds(52, 2, 11, 20);
				label[3][18].setVisible(false);
				panel_19.add(label[3][18]);
				
				label[3][19] = new JLabel(token[3]);
				label[3][19].setBounds(52, 2, 11, 20);
				label[3][19].setVisible(false);
				panel_20.add(label[3][19]);
			
				label[3][20] = new JLabel(token[3]);
				label[3][20].setBounds(52, 2, 11, 20);
				label[3][20].setVisible(false);
				panel_21.add(label[3][20]);
				
				label[3][21] = new JLabel(token[3]);
				label[3][21].setBounds(50, 8, 11, 20);
				label[3][21].setVisible(false);
				panel_22.add(label[3][21]);
				
				label[3][22] = new JLabel(token[3]);
				label[3][22].setBounds(50, 8, 11, 20);
				label[3][22].setVisible(false);
				panel_23.add(label[3][22]);
				
				label[3][23] = new JLabel(token[3]);
				label[3][23].setBounds(50, 8, 11, 20);
				label[3][23].setVisible(false);
				panel_24.add(label[3][23]);
				
				label[3][24] = new JLabel(token[3]);
				label[3][24].setBounds(50, 8, 11, 20);
				label[3][24].setVisible(false);
				panel_25.add(label[3][24]);
				
				label[3][25] = new JLabel(token[3]);
				label[3][25].setBounds(50, 8, 11, 20);
				label[3][25].setVisible(false);
				panel_26.add(label[3][25]);
				
				label[3][26] = new JLabel(token[3]);
				label[3][26].setBounds(50, 8, 11, 20);
				label[3][26].setVisible(false);
				panel_27.add(label[3][26]);
				
				label[3][27] = new JLabel(token[3]);
				label[3][27].setBounds(50, 8, 11, 20);
				label[3][27].setVisible(false);
				panel_28.add(label[3][27]);
				
				label[3][28] = new JLabel(token[3]);
				label[3][28].setBounds(50, 8, 11, 20);
				label[3][28].setVisible(false);
				panel_29.add(label[3][28]);
				
				label[3][29] = new JLabel(token[3]);
				label[3][29].setBounds(50, 8, 11, 20);
				label[3][29].setVisible(false);
				panel_30.add(label[3][29]);
				
				label[3][30] = new JLabel(token[3]);
				label[3][30].setBounds(52, 2, 11, 20);
				label[3][30].setVisible(false);
				panel_31.add(label[3][30]);
				
				label[3][31] = new JLabel(token[3]);
				label[3][31].setBounds(82, 2, 11, 20);
				label[3][31].setVisible(false);
				panel_32.add(label[3][31]);
				
				label[3][32] = new JLabel(token[3]);
				label[3][32].setBounds(82, 2, 11, 20);
				label[3][32].setVisible(false);
				panel_33.add(label[3][32]);
				
				label[3][33] = new JLabel(token[3]);
				label[3][33].setBounds(82, 2, 11, 20);
				label[3][33].setVisible(false);
				panel_34.add(label[3][33]);
				
				label[3][34] = new JLabel(token[3]);
				label[3][34].setBounds(82, 2, 11, 20);
				label[3][34].setVisible(false);
				panel_35.add(label[3][34]);
				
				label[3][35] = new JLabel(token[3]);
				label[3][35].setBounds(82, 2, 11, 20);
				label[3][35].setVisible(false);
				panel_36.add(label[3][35]);
				
				label[3][36] = new JLabel(token[3]);
				label[3][36].setBounds(82, 2, 11, 20);
				label[3][36].setVisible(false);
				panel_37.add(label[3][36]);
				
				label[3][37] = new JLabel(token[3]);
				label[3][37].setBounds(82, 2, 11, 20);
				label[3][37].setVisible(false);
				panel_38.add(label[3][37]);
				
				label[3][38] = new JLabel(token[3]);
				label[3][38].setBounds(82, 2, 11, 20);
				label[3][38].setVisible(false);
				panel_39.add(label[3][38]);
				
				label[3][39] = new JLabel(token[3]);
				label[3][39].setBounds(82, 2, 11, 20);
				label[3][39].setVisible(false);
				panel_40.add(label[3][39]);												
				
				label[3][40] = new JLabel(token[3]);
				label[3][40].setBounds(82, 2, 11, 20);
				label[3][40].setVisible(false);
				panel_41.add(label[3][40]);
				
	  			break;
	  	
	  	case 4:
		  		label[4][0] = new JLabel(token[4]);
				label[4][0].setBounds(4, 50, 11, 20);
				label[4][0].setVisible(true);
				panel_1.add(label[4][0]);
				
				label[4][1] = new JLabel(token[4]);
				label[4][1].setBounds(4, 50, 11, 20);
				label[4][1].setVisible(false);
				panel_2.add(label[4][1]);
				
				label[4][2] = new JLabel(token[4]);
				label[4][2].setBounds(4, 50, 11, 20);
				label[4][2].setVisible(false);
				panel_3.add(label[4][2]);
				
				label[4][3] = new JLabel(token[4]);
				label[4][3].setBounds(4, 50, 11, 20);
				label[4][3].setVisible(false);
				panel_4.add(label[4][3]);
				
				label[4][4] = new JLabel(token[4]);
				label[4][4].setBounds(4, 50, 11, 20);
				label[4][4].setVisible(false);
				panel_5.add(label[4][4]);
				
				label[4][5] = new JLabel(token[4]);
				label[4][5].setBounds(4, 50, 11, 20);
				label[4][5].setVisible(false);
				panel_6.add(label[4][5]);
				
				label[4][6] = new JLabel(token[4]);
				label[4][6].setBounds(4, 50, 11, 20);
				label[4][6].setVisible(false);
				panel_7.add(label[4][6]);
				
				label[4][7] = new JLabel(token[4]);
				label[4][7].setBounds(4, 50, 11, 20);
				label[4][7].setVisible(false);
				panel_8.add(label[4][7]);
				
				label[4][8] = new JLabel(token[4]);
				label[4][8].setBounds(4, 50, 11, 20);
				label[4][8].setVisible(false);
				panel_9.add(label[4][8]);
				
				label[4][9] = new JLabel(token[4]);
				label[4][9].setBounds(4, 50, 11, 20);
				label[4][9].setVisible(false);
				panel_10.add(label[4][9]);
				
				label[4][10] = new JLabel(token[4]);
				label[4][10].setBounds(36, 58, 11, 20);
				label[4][10].setVisible(false);
				panel_11.add(label[4][10]);
				
				label[4][11] = new JLabel(token[4]);
				label[4][11].setBounds(6, 26, 11, 20);
				label[4][11].setVisible(false);
				panel_12.add(label[4][11]);
				
				label[4][12] = new JLabel(token[4]);
				label[4][12].setBounds(6, 26, 11, 20);
				label[4][12].setVisible(false);
				panel_13.add(label[4][12]);
				
				label[4][13] = new JLabel(token[4]);
				label[4][13].setBounds(6, 26, 11, 20);
				label[4][13].setVisible(false);
				panel_14.add(label[4][13]);
				
				label[4][14] = new JLabel(token[4]);
				label[4][14].setBounds(6, 26, 11, 20);
				label[4][14].setVisible(false);
				panel_15.add(label[4][14]);
				
				label[4][15] = new JLabel(token[4]);
				label[4][15].setBounds(6, 26, 11, 20);
				label[4][15].setVisible(false);
				panel_16.add(label[4][15]);
				
				label[4][16] = new JLabel(token[4]);
				label[4][16].setBounds(6, 26, 11, 20);
				label[4][16].setVisible(false);
				panel_17.add(label[4][16]);
				
				label[4][17] = new JLabel(token[4]);
				label[4][17].setBounds(6, 26, 11, 20);
				label[4][17].setVisible(false);
				panel_18.add(label[4][17]);
				
				label[4][18] = new JLabel(token[4]);
				label[4][18].setBounds(6, 26, 11, 20);
				label[4][18].setVisible(false);
				panel_19.add(label[4][18]);
				
				label[4][19] = new JLabel(token[4]);
				label[4][19].setBounds(6, 26, 11, 20);
				label[4][19].setVisible(false);
				panel_20.add(label[4][19]);
				
				label[4][20] = new JLabel(token[4]);
				label[4][20].setBounds(6, 26, 11, 20);
				label[4][20].setVisible(false);
				panel_21.add(label[4][20]);
				
				label[4][21] = new JLabel(token[4]);
				label[4][21].setBounds(4, 34, 11, 20);
				label[4][21].setVisible(false);
				panel_22.add(label[4][21]);
				
				label[4][22] = new JLabel(token[4]);
				label[4][22].setBounds(4, 34, 11, 20);
				label[4][22].setVisible(false);
				panel_23.add(label[4][22]);
				
				label[4][23] = new JLabel(token[4]);
				label[4][23].setBounds(4, 34, 11, 20);
				label[4][23].setVisible(false);
				panel_24.add(label[4][23]);
				
				label[4][24] = new JLabel(token[4]);
				label[4][24].setBounds(4, 34, 11, 20);
				label[4][24].setVisible(false);
				panel_25.add(label[4][24]);
				
				label[4][25] = new JLabel(token[4]);
				label[4][25].setBounds(4, 34, 11, 20);
				label[4][25].setVisible(false);
				panel_26.add(label[4][25]);
				
				label[4][26] = new JLabel(token[4]);
				label[4][26].setBounds(4, 34, 11, 20);
				label[4][26].setVisible(false);
				panel_27.add(label[4][26]);
				
				label[4][27] = new JLabel(token[4]);
				label[4][27].setBounds(4, 34, 11, 20);
				label[4][27].setVisible(false);
				panel_28.add(label[4][27]);
				
				label[4][28] = new JLabel(token[4]);
				label[4][28].setBounds(4, 34, 11, 20);
				label[4][28].setVisible(false);
				panel_29.add(label[4][28]);
				
				label[4][29] = new JLabel(token[4]);
				label[4][29].setBounds(4, 34, 11, 20);
				label[4][29].setVisible(false);
				panel_30.add(label[4][29]);
				
				label[4][30] = new JLabel(token[4]);
				label[4][30].setBounds(6, 26, 11, 20);
				label[4][30].setVisible(false);
				panel_31.add(label[4][30]);
				
				label[4][31] = new JLabel(token[4]);
				label[4][31].setBounds(37, 26, 11, 20);
				label[4][31].setVisible(false);
				panel_32.add(label[4][31]);
				
				label[4][32] = new JLabel(token[4]);
				label[4][32].setBounds(37, 26, 11, 20);
				label[4][32].setVisible(false);
				panel_33.add(label[4][32]);
				
				label[4][33] = new JLabel(token[4]);
				label[4][33].setBounds(37, 26, 11, 20);
				label[4][33].setVisible(false);
				panel_34.add(label[4][33]);
				
				label[4][34] = new JLabel(token[4]);
				label[4][34].setBounds(37, 26, 11, 20);
				label[4][34].setVisible(false);
				panel_35.add(label[4][34]);
				
				label[4][35] = new JLabel(token[4]);
				label[4][35].setBounds(37, 26, 11, 20);
				label[4][35].setVisible(false);
				panel_36.add(label[4][35]);
				
				label[4][36] = new JLabel(token[4]);
				label[4][36].setBounds(37, 26, 11, 20);
				label[4][36].setVisible(false);
				panel_37.add(label[4][36]);
				
				label[4][37] = new JLabel(token[4]);
				label[4][37].setBounds(37, 26, 11, 20);
				label[4][37].setVisible(false);
				panel_38.add(label[4][37]);
				
				label[4][38] = new JLabel(token[4]);
				label[4][38].setBounds(37, 26, 11, 20);
				label[4][38].setVisible(false);
				panel_39.add(label[4][38]);
				
				label[4][39] = new JLabel(token[4]);
				label[4][39].setBounds(37, 26, 11, 20);
				label[4][39].setVisible(false);
				panel_40.add(label[4][39]);
				
				label[4][40] = new JLabel(token[4]);
				label[4][40].setBounds(37, 26, 11, 20);
				label[4][40].setVisible(false);
				panel_41.add(label[4][40]);
				
	  			break;
	  			
	  	case 5:
				label[5][0] = new JLabel(token[5]);
				label[5][0].setBounds(19, 50, 11, 20);
				label[5][0].setVisible(true);
				panel_1.add(label[5][0]);
				
				label[5][1] = new JLabel(token[5]);
				label[5][1].setBounds(19, 50, 11, 20);
				label[5][1].setVisible(false);
				panel_2.add(label[5][1]);
				
				label[5][2] = new JLabel(token[5]);
				label[5][2].setBounds(19, 50, 11, 20);
				label[5][2].setVisible(false);
				panel_3.add(label[5][2]);
				
				label[5][3] = new JLabel(token[5]);
				label[5][3].setBounds(19, 50, 11, 20);
				label[5][3].setVisible(false);
				panel_4.add(label[5][3]);
				
				label[5][4] = new JLabel(token[5]);
				label[5][4].setBounds(19, 50, 11, 20);
				label[5][4].setVisible(false);
				panel_5.add(label[5][4]);
				
				label[5][5] = new JLabel(token[5]);
				label[5][5].setBounds(19, 50, 11, 20);
				label[5][5].setVisible(false);
				panel_6.add(label[5][5]);
				
				label[5][6] = new JLabel(token[5]);
				label[5][6].setBounds(19, 50, 11, 20);
				label[5][6].setVisible(false);
				panel_7.add(label[5][6]);
				
				label[5][7] = new JLabel(token[5]);
				label[5][7].setBounds(19, 50, 11, 20);
				label[5][7].setVisible(false);
				panel_8.add(label[5][7]);
				
				label[5][8] = new JLabel(token[5]);
				label[5][8].setBounds(19, 50, 11, 20);
				label[5][8].setVisible(false);
				panel_9.add(label[5][8]);
				
				label[5][9] = new JLabel(token[5]);
				label[5][9].setBounds(19, 50, 11, 20);
				label[5][9].setVisible(false);
				panel_10.add(label[5][9]);
				
				label[5][10] = new JLabel(token[5]);
				label[5][10].setBounds(52, 58, 11, 20);
				label[5][10].setVisible(false);
				panel_11.add(label[5][10]);
				
				label[5][11] = new JLabel(token[5]);
				label[5][11].setBounds(21, 26, 11, 20);
				label[5][11].setVisible(false);
				panel_12.add(label[5][11]);
				
				label[5][12] = new JLabel(token[5]);
				label[5][12].setBounds(21, 26, 11, 20);
				label[5][12].setVisible(false);
				panel_13.add(label[5][12]);
				
				label[5][13] = new JLabel(token[5]);
				label[5][13].setBounds(21, 26, 11, 20);
				label[5][13].setVisible(false);
				panel_14.add(label[5][13]);
				
				label[5][14] = new JLabel(token[5]);
				label[5][14].setBounds(21, 26, 11, 20);
				label[5][14].setVisible(false);
				panel_15.add(label[5][14]);
				
				label[5][15] = new JLabel(token[5]);
				label[5][15].setBounds(21, 26, 11, 20);
				label[5][15].setVisible(false);
				panel_16.add(label[5][15]);
				
				label[5][16] = new JLabel(token[5]);
				label[5][16].setBounds(21, 26, 11, 20);
				label[5][16].setVisible(false);
				panel_17.add(label[5][16]);
				
				label[5][17] = new JLabel(token[5]);
				label[5][17].setBounds(21, 26, 11, 20);
				label[5][17].setVisible(false);
				panel_18.add(label[5][17]);
				
				label[5][18] = new JLabel(token[5]);
				label[5][18].setBounds(21, 26, 11, 20);
				label[5][18].setVisible(false);
				panel_19.add(label[5][18]);
				
				label[5][19] = new JLabel(token[5]);
				label[5][19].setBounds(21, 26, 11, 20);
				label[5][19].setVisible(false);
				panel_20.add(label[5][19]);
				
				label[5][20] = new JLabel(token[5]);
				label[5][20].setBounds(21, 26, 11, 20);
				label[5][20].setVisible(false);
				panel_21.add(label[5][20]);
				
				label[5][21] = new JLabel(token[5]);
				label[5][21].setBounds(19, 34, 11, 20);
				label[5][21].setVisible(false);
				panel_22.add(label[5][21]);
				
				label[5][22] = new JLabel(token[5]);
				label[5][22].setBounds(19, 34, 11, 20);
				label[5][22].setVisible(false);
				panel_23.add(label[5][22]);
				
				label[5][23] = new JLabel(token[5]);
				label[5][23].setBounds(19, 34, 11, 20);
				label[5][23].setVisible(false);
				panel_24.add(label[5][23]);
				
				label[5][24] = new JLabel(token[5]);
				label[5][24].setBounds(19, 34, 11, 20);
				label[5][24].setVisible(false);
				panel_25.add(label[5][24]);
				
				label[5][25] = new JLabel(token[5]);
				label[5][25].setBounds(19, 34, 11, 20);
				label[5][25].setVisible(false);
				panel_26.add(label[5][25]);
				
				label[5][26] = new JLabel(token[5]);
				label[5][26].setBounds(19, 34, 11, 20);
				label[5][26].setVisible(false);
				panel_27.add(label[5][26]);
				
				label[5][27] = new JLabel(token[5]);
				label[5][27].setBounds(19, 34, 11, 20);
				label[5][27].setVisible(false);
				panel_28.add(label[5][27]);
				
				label[5][28] = new JLabel(token[5]);
				label[5][28].setBounds(19, 34, 11, 20);
				label[5][28].setVisible(false);
				panel_29.add(label[5][28]);
				
				label[5][29] = new JLabel(token[5]);
				label[5][29].setBounds(19, 34, 11, 20);
				label[5][29].setVisible(false);
				panel_30.add(label[5][29]);
				
				label[5][30] = new JLabel(token[5]);
				label[5][30].setBounds(21, 26, 11, 20);
				label[5][30].setVisible(false);
				panel_31.add(label[5][30]);
				
				label[5][31] = new JLabel(token[5]);
				label[5][31].setBounds(52, 26, 11, 20);
				label[5][31].setVisible(false);
				panel_32.add(label[5][31]);
				
				label[5][32] = new JLabel(token[5]);
				label[5][32].setBounds(52, 26, 11, 20);
				label[5][32].setVisible(false);
				panel_33.add(label[5][32]);
				
				label[5][33] = new JLabel(token[5]);
				label[5][33].setBounds(52, 26, 11, 20);
				label[5][33].setVisible(false);
				panel_34.add(label[5][33]);
				
				label[5][34] = new JLabel(token[5]);
				label[5][34].setBounds(52, 26, 11, 20);
				label[5][34].setVisible(false);
				panel_35.add(label[5][34]);
				
				label[5][35] = new JLabel(token[5]);
				label[5][35].setBounds(52, 26, 11, 20);
				label[5][35].setVisible(false);
				panel_36.add(label[5][35]);
				
				label[5][36] = new JLabel(token[5]);
				label[5][36].setBounds(52, 26, 11, 20);
				label[5][36].setVisible(false);
				panel_37.add(label[5][36]);
				
				label[5][37] = new JLabel(token[5]);
				label[5][37].setBounds(52, 26, 11, 20);
				label[5][37].setVisible(false);
				panel_38.add(label[5][37]);
				
				label[5][38] = new JLabel(token[5]);
				label[5][38].setBounds(52, 26, 11, 20);
				label[5][38].setVisible(false);
				panel_39.add(label[5][38]);
				
				label[5][39] = new JLabel(token[5]);
				label[5][39].setBounds(52, 26, 11, 20);
				label[5][39].setVisible(false);
				panel_40.add(label[5][39]);
				
				label[5][40] = new JLabel(token[5]);
				label[5][40].setBounds(52, 26, 11, 20);
				label[5][40].setVisible(false);
				panel_41.add(label[5][40]);
				
	  			break;
	  			
	  	case 6:
				label[6][0] = new JLabel(token[6]);
				label[6][0].setBounds(35, 50, 11, 20);
				label[6][0].setVisible(true);
				panel_1.add(label[6][0]);
	  		
				label[6][1] = new JLabel(token[6]);
				label[6][1].setBounds(35, 50, 11, 20);
				label[6][1].setVisible(false);
				panel_2.add(label[6][1]);
				
				label[6][2] = new JLabel(token[6]);
				label[6][2].setBounds(35, 50, 11, 20);
				label[6][2].setVisible(false);
				panel_3.add(label[6][2]);
				
				label[6][3] = new JLabel(token[6]);
				label[6][3].setBounds(35, 50, 11, 20);
				label[6][3].setVisible(false);
				panel_4.add(label[6][3]);
				
				label[6][4] = new JLabel(token[6]);
				label[6][4].setBounds(35, 50, 11, 20);
				label[6][4].setVisible(false);
				panel_5.add(label[6][4]);
				
				label[6][5] = new JLabel(token[6]);
				label[6][5].setBounds(35, 50, 11, 20);
				label[6][5].setVisible(false);
				panel_6.add(label[6][5]);
				
				label[6][6] = new JLabel(token[6]);
				label[6][6].setBounds(35, 50, 11, 20);
				label[6][6].setVisible(false);
				panel_7.add(label[6][6]);
				
				label[6][7] = new JLabel(token[6]);
				label[6][7].setBounds(35, 50, 11, 20);
				label[6][7].setVisible(false);
				panel_8.add(label[6][7]);
				
				label[6][8] = new JLabel(token[6]);
				label[6][8].setBounds(35, 50, 11, 20);
				label[6][8].setVisible(false);
				panel_9.add(label[6][8]);
				
				label[6][9] = new JLabel(token[6]);
				label[6][9].setBounds(35, 50, 11, 20);
				label[6][9].setVisible(false);
				panel_10.add(label[6][9]);
				
				label[6][10] = new JLabel(token[6]);
				label[6][10].setBounds(70, 58, 11, 20);
				label[6][10].setVisible(false);
				panel_11.add(label[6][10]);
				
				label[6][11] = new JLabel(token[6]);
				label[6][11].setBounds(37, 26, 11, 20);
				label[6][11].setVisible(false);
				panel_12.add(label[6][11]);
				
				label[6][12] = new JLabel(token[6]);
				label[6][12].setBounds(37, 26, 11, 20);
				label[6][12].setVisible(false);
				panel_13.add(label[6][12]);
				
				label[6][13] = new JLabel(token[6]);
				label[6][13].setBounds(37, 26, 11, 20);
				label[6][13].setVisible(false);
				panel_14.add(label[6][13]);
				
				label[6][14] = new JLabel(token[6]);
				label[6][14].setBounds(37, 26, 11, 20);
				label[6][14].setVisible(false);
				panel_15.add(label[6][14]);
				
				label[6][15] = new JLabel(token[6]);
				label[6][15].setBounds(37, 26, 11, 20);
				label[6][15].setVisible(false);
				panel_16.add(label[6][15]);
				
				label[6][16] = new JLabel(token[6]);
				label[6][16].setBounds(37, 26, 11, 20);
				label[6][16].setVisible(false);
				panel_17.add(label[6][16]);
				
				label[6][17] = new JLabel(token[6]);
				label[6][17].setBounds(37, 26, 11, 20);
				label[6][17].setVisible(false);
				panel_18.add(label[6][17]);
				
				label[6][18] = new JLabel(token[6]);
				label[6][18].setBounds(37, 26, 11, 20);
				label[6][18].setVisible(false);
				panel_19.add(label[6][18]);
				
				label[6][19] = new JLabel(token[6]);
				label[6][19].setBounds(37, 26, 11, 20);
				label[6][19].setVisible(false);
				panel_20.add(label[6][19]);
			
				label[6][20] = new JLabel(token[6]);
				label[6][20].setBounds(37, 26, 11, 20);
				label[6][20].setVisible(false);
				panel_21.add(label[6][20]);
				
				label[6][21] = new JLabel(token[6]);
				label[6][21].setBounds(35, 34, 11, 20);
				label[6][21].setVisible(false);
				panel_22.add(label[6][21]);
				
				label[6][22] = new JLabel(token[6]);
				label[6][22].setBounds(35, 34, 11, 20);
				label[6][22].setVisible(false);
				panel_23.add(label[6][22]);
				
				label[6][23] = new JLabel(token[6]);
				label[6][23].setBounds(35, 34, 11, 20);
				label[6][23].setVisible(false);
				panel_24.add(label[6][23]);
				
				label[6][24] = new JLabel(token[6]);
				label[6][24].setBounds(35, 34, 11, 20);
				label[6][24].setVisible(false);
				panel_25.add(label[6][24]);
				
				label[6][25] = new JLabel(token[6]);
				label[6][25].setBounds(35, 34, 11, 20);
				label[6][25].setVisible(false);
				panel_26.add(label[6][25]);
				
				label[6][26] = new JLabel(token[6]);
				label[6][26].setBounds(35, 34, 11, 20);
				label[6][26].setVisible(false);
				panel_27.add(label[6][26]);
			
				label[6][27] = new JLabel(token[6]);
				label[6][27].setBounds(35, 34, 11, 20);
				label[6][27].setVisible(false);
				panel_28.add(label[6][27]);
				
				label[6][28] = new JLabel(token[6]);
				label[6][28].setBounds(35, 34, 11, 20);
				label[6][28].setVisible(false);
				panel_29.add(label[6][28]);
				
				label[6][29] = new JLabel(token[6]);
				label[6][29].setBounds(35, 34, 11, 20);
				label[6][29].setVisible(false);
				panel_30.add(label[6][29]);
				
				label[6][30] = new JLabel(token[6]);
				label[6][30].setBounds(37, 26, 11, 20);
				label[6][30].setVisible(false);
				panel_31.add(label[6][30]);
				
				label[6][31] = new JLabel(token[6]);
				label[6][31].setBounds(67, 26, 11, 20);
				label[6][31].setVisible(false);
				panel_32.add(label[6][31]);
				
				label[6][32] = new JLabel(token[6]);
				label[6][32].setBounds(67, 26, 11, 20);
				label[6][32].setVisible(false);
				panel_33.add(label[6][32]);
				
				label[6][33] = new JLabel(token[6]);
				label[6][33].setBounds(67, 26, 11, 20);
				label[6][33].setVisible(false);
				panel_34.add(label[6][33]);
				
				label[6][34] = new JLabel(token[6]);
				label[6][34].setBounds(67, 26, 11, 20);
				label[6][34].setVisible(false);
				panel_35.add(label[6][34]);
				
				label[6][35] = new JLabel(token[6]);
				label[6][35].setBounds(67, 26, 11, 20);
				label[6][35].setVisible(false);
				panel_36.add(label[6][35]);
			
				label[6][36] = new JLabel(token[6]);
				label[6][36].setBounds(67, 26, 11, 20);
				label[6][36].setVisible(false);
				panel_37.add(label[6][36]);
			
				label[6][37] = new JLabel(token[6]);
				label[6][37].setBounds(67, 26, 11, 20);
				label[6][37].setVisible(false);
				panel_38.add(label[6][37]);
				
				label[6][38] = new JLabel(token[6]);
				label[6][38].setBounds(67, 26, 11, 20);
				label[6][38].setVisible(false);
				panel_39.add(label[6][38]);
				
				label[6][39] = new JLabel(token[6]);
				label[6][39].setBounds(67, 26, 11, 20);
				label[6][39].setVisible(false);
				panel_40.add(label[6][39]);
				
				label[6][40] = new JLabel(token[6]);
				label[6][40].setBounds(67, 26, 11, 20);
				label[6][40].setVisible(false);
				panel_41.add(label[6][40]);
				
	  			break;
	  			
	  	case 7:
				label[7][0] = new JLabel(token[7]);
				label[7][0].setBounds(50, 50, 11, 20);
				label[7][0].setVisible(true);
				panel_1.add(label[7][0]);
	  		
				label[7][1] = new JLabel(token[7]);
				label[7][1].setBounds(50, 50, 11, 20);
				label[7][1].setVisible(false);
				panel_2.add(label[7][1]);
				
				label[7][2] = new JLabel(token[7]);
				label[7][2].setBounds(50, 50, 11, 20);
				label[7][2].setVisible(false);
				panel_3.add(label[7][2]);
				
				label[7][3] = new JLabel(token[7]);
				label[7][3].setBounds(50, 50, 11, 20);
				label[7][3].setVisible(false);
				panel_4.add(label[7][3]);
				
				label[7][4] = new JLabel(token[7]);
				label[7][4].setBounds(50, 50, 11, 20);
				label[7][4].setVisible(false);
				panel_5.add(label[7][4]);
				
				label[7][5] = new JLabel(token[7]);
				label[7][5].setBounds(50, 50, 11, 20);
				label[7][5].setVisible(false);
				panel_6.add(label[7][5]);
				
				label[7][6] = new JLabel(token[7]);
				label[7][6].setBounds(50, 50, 11, 20);
				label[7][6].setVisible(false);
				panel_7.add(label[7][6]);
				
				label[7][7] = new JLabel(token[7]);
				label[7][7].setBounds(50, 50, 11, 20);
				label[7][7].setVisible(false);
				panel_8.add(label[7][7]);
				
				label[7][8] = new JLabel(token[7]);
				label[7][8].setBounds(50, 50, 11, 20);
				label[7][8].setVisible(false);
				panel_9.add(label[7][8]);
				
				label[7][9] = new JLabel(token[7]);
				label[7][9].setBounds(50, 50, 11, 20);
				label[7][9].setVisible(false);
				panel_10.add(label[7][9]);
				
				label[7][10] = new JLabel(token[7]);
				label[7][10].setBounds(87, 58, 11, 20);
				label[7][10].setVisible(false);
				panel_11.add(label[7][10]);	
				
				label[7][11] = new JLabel(token[7]);
				label[7][11].setBounds(52, 26, 11, 20);
				label[7][11].setVisible(false);
				panel_12.add(label[7][11]);	
				
				label[7][12] = new JLabel(token[7]);
				label[7][12].setBounds(52, 26, 11, 20);
				label[7][12].setVisible(false);
				panel_13.add(label[7][12]);	
				
				label[7][13] = new JLabel(token[7]);
				label[7][13].setBounds(52, 26, 11, 20);
				label[7][13].setVisible(false);
				panel_14.add(label[7][13]);
				
				label[7][14] = new JLabel(token[7]);
				label[7][14].setBounds(52, 26, 11, 20);
				label[7][14].setVisible(false);
				panel_15.add(label[7][14]);
				
				label[7][15] = new JLabel(token[7]);
				label[7][15].setBounds(52, 26, 11, 20);
				label[7][15].setVisible(false);
				panel_16.add(label[7][15]);
				
				label[7][16] = new JLabel(token[7]);
				label[7][16].setBounds(52, 26, 11, 20);
				label[7][16].setVisible(false);
				panel_17.add(label[7][16]);
			
				label[7][17] = new JLabel(token[7]);
				label[7][17].setBounds(52, 26, 11, 20);
				label[7][17].setVisible(false);
				panel_18.add(label[7][17]);
			
				label[7][18] = new JLabel(token[7]);
				label[7][18].setBounds(52, 26, 11, 20);
				label[7][18].setVisible(false);
				panel_19.add(label[7][18]);
			
				label[7][19] = new JLabel(token[7]);
				label[7][19].setBounds(52, 26, 11, 20);
				label[7][19].setVisible(false);
				panel_20.add(label[7][19]);
			
				label[7][20] = new JLabel(token[7]);
				label[7][20].setBounds(52, 26, 11, 20);
				label[7][20].setVisible(false);
				panel_21.add(label[7][20]);
			
				label[7][21] = new JLabel(token[7]);
				label[7][21].setBounds(50, 34, 11, 20);
				label[7][21].setVisible(false);
				panel_22.add(label[7][21]);	
			
				label[7][22] = new JLabel(token[7]);
				label[7][22].setBounds(50, 34, 11, 20);
				label[7][22].setVisible(false);
				panel_23.add(label[7][22]);	
			
				label[7][23] = new JLabel(token[7]);
				label[7][23].setBounds(50, 34, 11, 20);
				label[7][23].setVisible(false);
				panel_24.add(label[7][23]);	
			
				label[7][24] = new JLabel(token[7]);
				label[7][24].setBounds(50, 34, 11, 20);
				label[7][24].setVisible(false);
				panel_25.add(label[7][24]);	
			
				label[7][25] = new JLabel(token[7]);
				label[7][25].setBounds(50, 34, 11, 20);
				label[7][25].setVisible(false);
				panel_26.add(label[7][25]);
				
				label[7][26] = new JLabel(token[7]);
				label[7][26].setBounds(50, 34, 11, 20);
				label[7][26].setVisible(false);
				panel_27.add(label[7][26]);
			
				label[7][27] = new JLabel(token[7]);
				label[7][27].setBounds(50, 34, 11, 20);
				label[7][27].setVisible(false);
				panel_28.add(label[7][27]);
			
				label[7][28] = new JLabel(token[7]);
				label[7][28].setBounds(50, 34, 11, 20);
				label[7][28].setVisible(false);
				panel_29.add(label[7][28]);
			
				label[7][29] = new JLabel(token[7]);
				label[7][29].setBounds(50, 34, 11, 20);
				label[7][29].setVisible(false);
				panel_30.add(label[7][29]);
			
				label[7][30] = new JLabel(token[7]);
				label[7][30].setBounds(52, 26, 11, 20);
				label[7][30].setVisible(false);
				panel_31.add(label[7][30]);
			
				label[7][31] = new JLabel(token[7]);
				label[7][31].setBounds(82, 26, 11, 20);
				label[7][31].setVisible(false);
				panel_32.add(label[7][31]);
			
				label[7][32] = new JLabel(token[7]);
				label[7][32].setBounds(82, 26, 11, 20);
				label[7][32].setVisible(false);
				panel_33.add(label[7][32]);
			
				label[7][33] = new JLabel(token[7]);
				label[7][33].setBounds(82, 26, 11, 20);
				label[7][33].setVisible(false);
				panel_34.add(label[7][33]);
			
				label[7][34] = new JLabel(token[7]);
				label[7][34].setBounds(82, 26, 11, 20);
				label[7][34].setVisible(false);
				panel_35.add(label[7][34]);

				label[7][35] = new JLabel(token[7]);
				label[7][35].setBounds(82, 26, 11, 20);
				label[7][35].setVisible(false);
				panel_36.add(label[7][35]);
			
				label[7][36] = new JLabel(token[7]);
				label[7][36].setBounds(82, 26, 11, 20);
				label[7][36].setVisible(false);
				panel_37.add(label[7][36]);
			
				label[7][37] = new JLabel(token[7]);
				label[7][37].setBounds(82, 26, 11, 20);
				label[7][37].setVisible(false);
				panel_38.add(label[7][37]);
			
				label[7][38] = new JLabel(token[7]);
				label[7][38].setBounds(82, 26, 11, 20);
				label[7][38].setVisible(false);
				panel_38.add(label[7][38]);
			
				label[7][39] = new JLabel(token[7]);
				label[7][39].setBounds(82, 26, 11, 20);
				label[7][39].setVisible(false);
				panel_39.add(label[7][39]);
				
				label[7][40] = new JLabel(token[7]);
				label[7][40].setBounds(82, 26, 11, 20);
				label[7][40].setVisible(false);
				panel_41.add(label[7][40]);
			
				break;
	  }
	  
  }

  public void initializeHouseIcons(){
		houseLbl[0][0] = new JLabel(houseTkn);
		houseLbl[0][0].setBounds(0, 0, 16, 19);
		houseLbl[0][0].setVisible(false);
		panel_2.add(houseLbl[0][0]);
		
		houseLbl[0][1] = new JLabel(houseTkn);
		houseLbl[0][1].setBounds(16, 0, 16, 19);
		houseLbl[0][1].setVisible(false);
		panel_2.add(houseLbl[0][1]);
		
		houseLbl[0][2] = new JLabel(houseTkn);
		houseLbl[0][2].setBounds(32, 0, 16, 19);
		houseLbl[0][2].setVisible(false);
		panel_2.add(houseLbl[0][2]);
		
		houseLbl[0][3] = new JLabel(houseTkn);
		houseLbl[0][3].setBounds(48, 0, 16, 19);
		houseLbl[0][3].setVisible(false);
		panel_2.add(houseLbl[0][3]);
		
		houseLbl[0][4] = new JLabel (hotelTkn1);
		houseLbl[0][4].setBounds(0,0,65,19);
		houseLbl[0][4].setVisible(false);
		panel_2.add(houseLbl[0][4]);
		
		houseLbl[1][0] = new JLabel(houseTkn);
		houseLbl[1][0].setBounds(0, 0, 16, 19);
		houseLbl[1][0].setVisible(false);
		panel_4.add(houseLbl[1][0]);
		
		houseLbl[1][1] = new JLabel(houseTkn);
		houseLbl[1][1].setBounds(16, 0, 16, 19);
		houseLbl[1][1].setVisible(false);
		panel_4.add(houseLbl[1][1]);
		
		houseLbl[1][2] = new JLabel(houseTkn);
		houseLbl[1][2].setBounds(32, 0, 16, 19);
		houseLbl[1][2].setVisible(false);
		panel_4.add(houseLbl[1][2]);
		
		houseLbl[1][3] = new JLabel(houseTkn);
		houseLbl[1][3].setBounds(48, 0, 16, 19);
		houseLbl[1][3].setVisible(false);
		panel_4.add(houseLbl[1][3]);
		
		houseLbl[1][4] = new JLabel (hotelTkn1);
		houseLbl[1][4].setBounds(0,0,65,19);
		houseLbl[1][4].setVisible(false);
		panel_4.add(houseLbl[1][4]);
		
		houseLbl[2][0] = new JLabel(houseTkn);
		houseLbl[2][0].setBounds(0, 0, 16, 19);
		houseLbl[2][0].setVisible(false);
		panel_7.add(houseLbl[2][0]);
		
		houseLbl[2][1] = new JLabel(houseTkn);
		houseLbl[2][1].setBounds(16, 0, 16, 19);
		houseLbl[2][1].setVisible(false);
		panel_7.add(houseLbl[2][1]);
		
		houseLbl[2][2] = new JLabel(houseTkn);
		houseLbl[2][2].setBounds(32, 0, 16, 19);
		houseLbl[2][2].setVisible(false);
		panel_7.add(houseLbl[2][2]);
		
		houseLbl[2][3] = new JLabel(houseTkn);
		houseLbl[2][3].setBounds(48, 0, 16, 19);
		houseLbl[2][3].setVisible(false);
		panel_7.add(houseLbl[2][3]);
		
		houseLbl[2][4] = new JLabel (hotelTkn1);
		houseLbl[2][4].setBounds(0,0,65,19);
		houseLbl[2][4].setVisible(false);
		panel_7.add(houseLbl[2][4]);
		
		houseLbl[3][0] = new JLabel(houseTkn);
		houseLbl[3][0].setBounds(0, 0, 16, 19);
		houseLbl[3][0].setVisible(false);
		panel_9.add(houseLbl[3][0]);
		
		houseLbl[3][1] = new JLabel(houseTkn);
		houseLbl[3][1].setBounds(16, 0, 16, 19);
		houseLbl[3][1].setVisible(false);
		panel_9.add(houseLbl[3][1]);
		
		houseLbl[3][2] = new JLabel(houseTkn);
		houseLbl[3][2].setBounds(32, 0, 16, 19);
		houseLbl[3][2].setVisible(false);
		panel_9.add(houseLbl[3][2]);
		
		houseLbl[3][3] = new JLabel(houseTkn);
		houseLbl[3][3].setBounds(48, 0, 16, 19);
		houseLbl[3][3].setVisible(false);
		panel_9.add(houseLbl[3][3]);
		
		houseLbl[3][4] = new JLabel (hotelTkn1);
		houseLbl[3][4].setBounds(0,0,65,19);
		houseLbl[3][4].setVisible(false);
		panel_9.add(houseLbl[3][4]);
		
		houseLbl[4][0] = new JLabel(houseTkn);
		houseLbl[4][0].setBounds(0, 0, 16, 19);
		houseLbl[4][0].setVisible(false);
		panel_10.add(houseLbl[4][0]);
		
		houseLbl[4][1] = new JLabel(houseTkn);
		houseLbl[4][1].setBounds(16, 0, 16, 19);
		houseLbl[4][1].setVisible(false);
		panel_10.add(houseLbl[4][1]);
		
		houseLbl[4][2] = new JLabel(houseTkn);
		houseLbl[4][2].setBounds(32, 0, 16, 19);
		houseLbl[4][2].setVisible(false);
		panel_10.add(houseLbl[4][2]);
		
		houseLbl[4][3] = new JLabel(houseTkn);
		houseLbl[4][3].setBounds(48, 0, 16, 19);
		houseLbl[4][3].setVisible(false);
		panel_10.add(houseLbl[4][3]);
		
		houseLbl[4][4] = new JLabel (hotelTkn1);
		houseLbl[4][4].setBounds(0,0,65,19);
		houseLbl[4][4].setVisible(false);
		panel_10.add(houseLbl[4][4]);
		
		
		/**This is where the left side homes begin**/
		houseLbl[5][0] = new JLabel(houseTkn);
		houseLbl[5][0].setBounds(81, 0, 20, 12);
		houseLbl[5][0].setVisible(false);
		panel_12.add(houseLbl[5][0]);
		
		houseLbl[5][1] = new JLabel(houseTkn);
		houseLbl[5][1].setBounds(81, 12, 20, 12);
		houseLbl[5][1].setVisible(false);
		panel_12.add(houseLbl[5][1]);
		
		houseLbl[5][2] = new JLabel(houseTkn);
		houseLbl[5][2].setBounds(81, 24, 20, 12);
		houseLbl[5][2].setVisible(false);
		panel_12.add(houseLbl[5][2]);
		
		houseLbl[5][3] = new JLabel(houseTkn);
		houseLbl[5][3].setBounds(81, 36, 20, 12);
		houseLbl[5][3].setVisible(false);
		panel_12.add(houseLbl[5][3]);
		
		houseLbl[5][4] = new JLabel(hotelTkn2);
		houseLbl[5][4].setBounds(81, 469, 21, 49);
		houseLbl[5][4].setVisible(false);
		panel_12.add(houseLbl[5][4]);
		
		houseLbl[6][0] = new JLabel(houseTkn);
		houseLbl[6][0].setBounds(81, 0, 20, 12);
		houseLbl[6][0].setVisible(false);
		panel_14.add(houseLbl[6][0]);
		
		houseLbl[6][1] = new JLabel(houseTkn);
		houseLbl[6][1].setBounds(81, 12, 20, 12);
		houseLbl[6][1].setVisible(false);
		panel_14.add(houseLbl[6][1]);
		
		houseLbl[6][2] = new JLabel(houseTkn);
		houseLbl[6][2].setBounds(81, 24, 20, 12);
		houseLbl[6][2].setVisible(false);
		panel_14.add(houseLbl[6][2]);
		
		houseLbl[6][3] = new JLabel(houseTkn);
		houseLbl[6][3].setBounds(81, 36, 20, 12);
		houseLbl[6][3].setVisible(false);
		panel_14.add(houseLbl[6][3]);
		
		houseLbl[6][4] = new JLabel(hotelTkn2);
		houseLbl[6][4].setBounds(81, 469, 21, 49);
		houseLbl[6][4].setVisible(false);
		panel_14.add(houseLbl[6][4]);
		
		houseLbl[7][0] = new JLabel(houseTkn);
		houseLbl[7][0].setBounds(81, 0, 20, 12);
		houseLbl[7][0].setVisible(false);
		panel_15.add(houseLbl[7][0]);
		
		houseLbl[7][1] = new JLabel(houseTkn);
		houseLbl[7][1].setBounds(81, 12, 20, 12);
		houseLbl[7][1].setVisible(false);
		panel_15.add(houseLbl[7][1]);
		
		houseLbl[7][2] = new JLabel(houseTkn);
		houseLbl[7][2].setBounds(81, 24, 20, 12);
		houseLbl[7][2].setVisible(false);
		panel_15.add(houseLbl[7][2]);
		
		houseLbl[7][3] = new JLabel(houseTkn);
		houseLbl[7][3].setBounds(81, 36, 20, 12);
		houseLbl[7][3].setVisible(false);
		panel_15.add(houseLbl[7][3]);
		
		houseLbl[7][4] = new JLabel(hotelTkn2);
		houseLbl[7][4].setBounds(81, 469, 21, 49);
		houseLbl[7][4].setVisible(false);
		panel_15.add(houseLbl[7][4]);
		
		houseLbl[8][0] = new JLabel(houseTkn);
		houseLbl[8][0].setBounds(81, 0, 20, 12);
		houseLbl[8][0].setVisible(false);
		panel_17.add(houseLbl[8][0]);
		
		houseLbl[8][1] = new JLabel(houseTkn);
		houseLbl[8][1].setBounds(81, 12, 20, 12);
		houseLbl[8][1].setVisible(false);
		panel_17.add(houseLbl[8][1]);
		
		houseLbl[8][2] = new JLabel(houseTkn);
		houseLbl[8][2].setBounds(81, 24, 20, 12);
		houseLbl[8][2].setVisible(false);
		panel_17.add(houseLbl[8][2]);
		
		houseLbl[8][3] = new JLabel(houseTkn);
		houseLbl[8][3].setBounds(81, 36, 20, 12);
		houseLbl[8][3].setVisible(false);
		panel_17.add(houseLbl[8][3]);
		
		houseLbl[8][4] = new JLabel(hotelTkn2);
		houseLbl[8][4].setBounds(81, 469, 21, 49);
		houseLbl[8][4].setVisible(false);
		panel_17.add(houseLbl[8][4]);
		
		houseLbl[9][0] = new JLabel(houseTkn);
		houseLbl[9][0].setBounds(81, 0, 20, 12);
		houseLbl[9][0].setVisible(false);
		panel_19.add(houseLbl[9][0]);
		
		houseLbl[9][1] = new JLabel(houseTkn);
		houseLbl[9][1].setBounds(81, 12, 20, 12);
		houseLbl[9][1].setVisible(false);
		panel_19.add(houseLbl[9][1]);
		
		houseLbl[9][2] = new JLabel(houseTkn);
		houseLbl[9][2].setBounds(81, 24, 20, 12);
		houseLbl[9][2].setVisible(false);
		panel_19.add(houseLbl[9][2]);
		
		houseLbl[9][3] = new JLabel(houseTkn);
		houseLbl[9][3].setBounds(81, 36, 20, 12);
		houseLbl[9][3].setVisible(false);
		panel_19.add(houseLbl[9][3]);
		
		houseLbl[9][4] = new JLabel(hotelTkn2);
		houseLbl[9][4].setBounds(81, 469, 21, 49);
		houseLbl[9][4].setVisible(false);
		panel_19.add(houseLbl[9][4]);
		
		houseLbl[10][0] = new JLabel(houseTkn);
		houseLbl[10][0].setBounds(81, 0, 20, 12);
		houseLbl[10][0].setVisible(false);
		panel_20.add(houseLbl[10][0]);
		
		houseLbl[10][1] = new JLabel(houseTkn);
		houseLbl[10][1].setBounds(81, 12, 20, 12);
		houseLbl[10][1].setVisible(false);
		panel_20.add(houseLbl[10][1]);
		
		houseLbl[10][2] = new JLabel(houseTkn);
		houseLbl[10][2].setBounds(81, 24, 20, 12);
		houseLbl[10][2].setVisible(false);
		panel_20.add(houseLbl[10][2]);
		
		houseLbl[10][3] = new JLabel(houseTkn);
		houseLbl[10][3].setBounds(81, 36, 20, 12);
		houseLbl[10][3].setVisible(false);
		panel_20.add(houseLbl[10][3]);
		
		houseLbl[10][4] = new JLabel(hotelTkn2);
		houseLbl[10][4].setBounds(81, 469, 21, 49);
		houseLbl[10][4].setVisible(false);
		panel_20.add(houseLbl[10][4]);
		
		/**This is where the top homes begin**/
		
		houseLbl[11][0] = new JLabel(houseTkn);
		houseLbl[11][0].setBounds(0, 63, 15, 19);
		houseLbl[11][0].setVisible(false);
		panel_22.add(houseLbl[11][0]);
		
		houseLbl[11][1] = new JLabel(houseTkn);
		houseLbl[11][1].setBounds(16, 63, 15, 19);
		houseLbl[11][1].setVisible(false);
		panel_22.add(houseLbl[11][1]);
		
		houseLbl[11][2] = new JLabel(houseTkn);
		houseLbl[11][2].setBounds(32, 63, 15, 19);
		houseLbl[11][2].setVisible(false);
		panel_22.add(houseLbl[11][2]);
		
		houseLbl[11][3] = new JLabel(houseTkn);
		houseLbl[11][3].setBounds(48, 63, 15, 19);
		houseLbl[11][3].setVisible(false);
		panel_22.add(houseLbl[11][3]);
		
		houseLbl[11][4] = new JLabel(hotelTkn3);
		houseLbl[11][4].setBounds(0, 68, 65, 14);
		houseLbl[11][4].setVisible(false);
		panel_22.add(houseLbl[11][4]);
		
		houseLbl[12][0] = new JLabel(houseTkn);
		houseLbl[12][0].setBounds(0, 63, 15, 19);
		houseLbl[12][0].setVisible(false);
		panel_24.add(houseLbl[12][0]);
		
		houseLbl[12][1] = new JLabel(houseTkn);
		houseLbl[12][1].setBounds(16, 63, 15, 19);
		houseLbl[12][1].setVisible(false);
		panel_24.add(houseLbl[12][1]);
		
		houseLbl[12][2] = new JLabel(houseTkn);
		houseLbl[12][2].setBounds(32, 63, 15, 19);
		houseLbl[12][2].setVisible(false);
		panel_24.add(houseLbl[12][2]);
		
		houseLbl[12][3] = new JLabel(houseTkn);
		houseLbl[12][3].setBounds(48, 63, 15, 19);
		houseLbl[12][3].setVisible(false);
		panel_24.add(houseLbl[12][3]);
		
		houseLbl[12][4] = new JLabel(hotelTkn3);
		houseLbl[12][4].setBounds(0, 68, 65, 14);
		houseLbl[12][4].setVisible(false);
		panel_24.add(houseLbl[12][4]);
		
		houseLbl[13][0] = new JLabel(houseTkn);
		houseLbl[13][0].setBounds(0, 63, 15, 19);
		houseLbl[13][0].setVisible(false);
		panel_25.add(houseLbl[13][0]);
		
		houseLbl[13][1] = new JLabel(houseTkn);
		houseLbl[13][1].setBounds(16, 63, 15, 19);
		houseLbl[13][1].setVisible(false);
		panel_25.add(houseLbl[13][1]);
		
		houseLbl[13][2] = new JLabel(houseTkn);
		houseLbl[13][2].setBounds(32, 63, 15, 19);
		houseLbl[13][2].setVisible(false);
		panel_25.add(houseLbl[13][2]);
		
		houseLbl[13][3] = new JLabel(houseTkn);
		houseLbl[13][3].setBounds(48, 63, 15, 19);
		houseLbl[13][3].setVisible(false);
		panel_25.add(houseLbl[13][3]);
		
		houseLbl[13][4] = new JLabel(hotelTkn3);
		houseLbl[13][4].setBounds(0, 68, 65, 14);
		houseLbl[13][4].setVisible(false);
		panel_25.add(houseLbl[13][4]);
		
		houseLbl[14][0] = new JLabel(houseTkn);
		houseLbl[14][0].setBounds(0, 63, 15, 19);
		houseLbl[14][0].setVisible(false);
		panel_27.add(houseLbl[14][0]);
		
		houseLbl[14][1] = new JLabel(houseTkn);
		houseLbl[14][1].setBounds(16, 63, 15, 19);
		houseLbl[14][1].setVisible(false);
		panel_27.add(houseLbl[14][1]);
		
		houseLbl[14][2] = new JLabel(houseTkn);
		houseLbl[14][2].setBounds(32, 63, 15, 19);
		houseLbl[14][2].setVisible(false);
		panel_27.add(houseLbl[14][2]);
		
		houseLbl[14][3] = new JLabel(houseTkn);
		houseLbl[14][3].setBounds(48, 63, 15, 19);
		houseLbl[14][3].setVisible(false);
		panel_27.add(houseLbl[14][3]);
		
		houseLbl[14][4] = new JLabel(hotelTkn3);
		houseLbl[14][4].setBounds(0, 68, 65, 14);
		houseLbl[14][4].setVisible(false);
		panel_27.add(houseLbl[14][4]);
		
		houseLbl[15][0] = new JLabel(houseTkn);
		houseLbl[15][0].setBounds(0, 63, 15, 19);
		houseLbl[15][0].setVisible(false);
		panel_28.add(houseLbl[15][0]);
		
		houseLbl[15][1] = new JLabel(houseTkn);
		houseLbl[15][1].setBounds(16, 63, 15, 19);
		houseLbl[15][1].setVisible(false);
		panel_28.add(houseLbl[15][1]);
		
		houseLbl[15][2] = new JLabel(houseTkn);
		houseLbl[15][2].setBounds(32, 63, 15, 19);
		houseLbl[15][2].setVisible(false);
		panel_28.add(houseLbl[15][2]);
		
		houseLbl[15][3] = new JLabel(houseTkn);
		houseLbl[15][3].setBounds(48, 63, 15, 19);
		houseLbl[15][3].setVisible(false);
		panel_28.add(houseLbl[15][3]);
		
		houseLbl[15][4] = new JLabel(hotelTkn3);
		houseLbl[15][4].setBounds(0, 68, 65, 14);
		houseLbl[15][4].setVisible(false);
		panel_28.add(houseLbl[15][4]);
		
		houseLbl[16][0] = new JLabel(houseTkn);
		houseLbl[16][0].setBounds(0, 63, 15, 19);
		houseLbl[16][0].setVisible(false);
		panel_30.add(houseLbl[16][0]);
		
		houseLbl[16][1] = new JLabel(houseTkn);
		houseLbl[16][1].setBounds(16, 63, 15, 19);
		houseLbl[16][1].setVisible(false);
		panel_30.add(houseLbl[16][1]);
		
		houseLbl[16][2] = new JLabel(houseTkn);
		houseLbl[16][2].setBounds(32, 63, 15, 19);
		houseLbl[16][2].setVisible(false);
		panel_30.add(houseLbl[16][2]);
		
		houseLbl[16][3] = new JLabel(houseTkn);
		houseLbl[16][3].setBounds(48, 63, 15, 19);
		houseLbl[16][3].setVisible(false);
		panel_30.add(houseLbl[16][3]);
		
		houseLbl[16][4] = new JLabel(hotelTkn3);
		houseLbl[16][4].setBounds(0, 68, 65, 14);
		houseLbl[16][4].setVisible(false);
		panel_30.add(houseLbl[16][4]);
		
		/**32,33,35**/
		
		houseLbl[17][0] = new JLabel(houseTkn);
		houseLbl[17][0].setBounds(2, 0, 22, 12);
		houseLbl[17][0].setVisible(false);
		panel_32.add(houseLbl[17][0]);
		
		houseLbl[17][1] = new JLabel(houseTkn);
		houseLbl[17][1].setBounds(2, 11, 22, 12);
		houseLbl[17][1].setVisible(false);
		panel_32.add(houseLbl[17][1]);
		
		houseLbl[17][2] = new JLabel(houseTkn);
		houseLbl[17][2].setBounds(2, 25, 22, 12);
		houseLbl[17][2].setVisible(false);
		panel_32.add(houseLbl[17][2]);
		
		houseLbl[17][3] = new JLabel(houseTkn);
		houseLbl[17][3].setBounds(2, 36, 22, 12);
		houseLbl[17][3].setVisible(false);
		panel_32.add(houseLbl[17][3]);
		
		houseLbl[17][4] = new JLabel(hotelTkn4);
		houseLbl[17][4].setBounds(2, 0, 22, 48);
		houseLbl[17][4].setVisible(false);
		panel_32.add(houseLbl[17][4]);
		
		houseLbl[18][0] = new JLabel(houseTkn);
		houseLbl[18][0].setBounds(2, 0, 22, 12);
		houseLbl[18][0].setVisible(false);
		panel_33.add(houseLbl[18][0]);
		
		houseLbl[18][1] = new JLabel(houseTkn);
		houseLbl[18][1].setBounds(2, 11, 22, 12);
		houseLbl[18][1].setVisible(false);
		panel_33.add(houseLbl[18][1]);
		
		houseLbl[18][2] = new JLabel(houseTkn);
		houseLbl[18][2].setBounds(2, 25, 22, 12);
		houseLbl[18][2].setVisible(false);
		panel_33.add(houseLbl[18][2]);
		
		houseLbl[18][3] = new JLabel(houseTkn);
		houseLbl[18][3].setBounds(2, 36, 22, 12);
		houseLbl[18][3].setVisible(false);
		panel_33.add(houseLbl[18][3]);
		
		houseLbl[18][4] = new JLabel(hotelTkn4);
		houseLbl[18][4].setBounds(2, 0, 22, 48);
		houseLbl[18][4].setVisible(false);
		panel_33.add(houseLbl[18][4]);
		
		houseLbl[19][0] = new JLabel(houseTkn);
		houseLbl[19][0].setBounds(2, 0, 22, 12);
		houseLbl[19][0].setVisible(false);
		panel_35.add(houseLbl[19][0]);
		
		houseLbl[19][1] = new JLabel(houseTkn);
		houseLbl[19][1].setBounds(2, 11, 22, 12);
		houseLbl[19][1].setVisible(false);
		panel_35.add(houseLbl[19][1]);
		
		houseLbl[19][2] = new JLabel(houseTkn);
		houseLbl[19][2].setBounds(2, 25, 22, 12);
		houseLbl[19][2].setVisible(false);
		panel_35.add(houseLbl[19][2]);
		
		houseLbl[19][3] = new JLabel(houseTkn);
		houseLbl[19][3].setBounds(2, 36, 22, 12);
		houseLbl[19][3].setVisible(false);
		panel_35.add(houseLbl[19][3]);
		
		houseLbl[19][4] = new JLabel(hotelTkn4);
		houseLbl[19][4].setBounds(2, 0, 22, 48);
		houseLbl[19][4].setVisible(false);
		panel_35.add(houseLbl[19][4]);
		
		houseLbl[20][0] = new JLabel(houseTkn);
		houseLbl[20][0].setBounds(2, 0, 22, 12);
		houseLbl[20][0].setVisible(false);
		panel_38.add(houseLbl[20][0]);
		
		houseLbl[20][1] = new JLabel(houseTkn);
		houseLbl[20][1].setBounds(2, 11, 22, 12);
		houseLbl[20][1].setVisible(false);
		panel_38.add(houseLbl[20][1]);
		
		houseLbl[20][2] = new JLabel(houseTkn);
		houseLbl[20][2].setBounds(2, 25, 22, 12);
		houseLbl[20][2].setVisible(false);
		panel_38.add(houseLbl[20][2]);
		
		houseLbl[20][3] = new JLabel(houseTkn);
		houseLbl[20][3].setBounds(2, 36, 22, 12);
		houseLbl[20][3].setVisible(false);
		panel_38.add(houseLbl[20][3]);
		
		houseLbl[20][4] = new JLabel(hotelTkn4);
		houseLbl[20][4].setBounds(2, 0, 22, 48);
		houseLbl[20][4].setVisible(false);
		panel_38.add(houseLbl[20][4]);
		
		houseLbl[21][0] = new JLabel(houseTkn);
		houseLbl[21][0].setBounds(2, 0, 22, 12);
		houseLbl[21][0].setVisible(false);
		panel_40.add(houseLbl[21][0]);
		
		houseLbl[21][1] = new JLabel(houseTkn);
		houseLbl[21][1].setBounds(2, 11, 22, 12);
		houseLbl[21][1].setVisible(false);
		panel_40.add(houseLbl[21][1]);
		
		houseLbl[21][2] = new JLabel(houseTkn);
		houseLbl[21][2].setBounds(2, 25, 22, 12);
		houseLbl[21][2].setVisible(false);
		panel_40.add(houseLbl[21][2]);
		
		houseLbl[21][3] = new JLabel(houseTkn);
		houseLbl[21][3].setBounds(2, 36, 22, 12);
		houseLbl[21][3].setVisible(false);
		panel_40.add(houseLbl[21][3]);
		
		houseLbl[21][4] = new JLabel(hotelTkn4);
		houseLbl[21][4].setBounds(2, 0, 22, 48);
		houseLbl[21][4].setVisible(false);
		panel_40.add(houseLbl[21][4]);		
  }
  
  public void reinitializeHouseIcons(){
	  
	  PropertyBlock[] tempProp = new PropertyBlock[22];
	  ArrayList<PropertyBlock> propArrayList = new ArrayList<PropertyBlock>();
	  
	  for(int counter = 0; counter<this.b.getBlkArray().length; counter++){
		  
		  if(this.b.getBlkArray()[counter] instanceof PropertyBlock){
			  
			  propArrayList.add((PropertyBlock) this.b.getBlkArray()[counter]);
			  
		  }
		  
	  }
	  
	  propArrayList.toArray(tempProp);
	  
	  for(int counter = 0; counter<tempProp.length; counter++){
		  
		  this.displayHouseTokens(tempProp[counter].getBlockNumber());
		  
	  }
	  
  }
  
  public void playerSelection(int select){
	  switch(select){
			case 1: 
					if(!this.b.getIsGodMode())
						this.diceui = new DiceUI(this.b.getCurrentPlayer());
					else
						this.godDice = new GodDiceUI(this.b.getCurrentPlayer());
					break;
			case 2:
					this.propertySelectionUI = new PropertySelectionUI(this.b.getCurrentPlayer(), this.b.getBlkArray());
					break;
			case 3:
					this.tradeUI = new TradeUI(this.b.getBlkArray(), this.b.getCurrentPlayer(), this.b.getP());
					break;
			 case 4:
				 this.activateTransferAssetsToBank();
				 break;
			 case 5:
				 this.bailSequence();
				 break;
			case 6:
				 this.auctionUI = new AuctionUI(this.b.getCurrentPlayer().getCurrentBlockPos(), this.b.getP());
				 break;
			
	  }
	  	
  }
  
  public void sendOutOfJail(){
	  
	  b.getCurrentPlayer().setCurrentBlockPos(b.getBlkArray()[10]);
	  label[b.getPlayerQueue()][10].setVisible(true);
	  label[b.getPlayerQueue()][40].setVisible(false);
	
  }
	  
  private void bailSequence(){
	  
	  b.getCurrentPlayer().subtractMoney(50);
	  this.sendOutOfJail();
	  this.nextPlayer();
	  
  }
  
  public void movePlayerToken(int cPlayerNumber, int cBlockNumber){

	  
	  label[cPlayerNumber][cBlockNumber].setVisible(true);
	  if(cBlockNumber>0){
		  label[cPlayerNumber][cBlockNumber-1].setVisible(false);
	  }
	  
	  
	  //possible bug area caused by brian cuz he can't set shit to zero
	  
	  /*if(b.getCurrentPlayer().getCurrentBlockPos().getBlockNumber() == 40 && b.getCurrentPlayer().getJailCounter() == 3){
		  
	  this.sendOutOfJail();
		  
	  }*/
		  
	  //this.playerSelect = new PlayerSelectionUI(this.b.getCurrentPlayer());
  }
 
  public void movePlayerTokenBackwards(int cPlayerNumber, int cBlockNumber){

	  
	  label[cPlayerNumber][cBlockNumber].setVisible(true);
	  if(cBlockNumber>0){
		  label[cPlayerNumber][cBlockNumber+1].setVisible(false);
	  }
	  
	  
	  //possible bug area caused by brian cuz he can't set shit to zero
	  
	  /*if(b.getCurrentPlayer().getCurrentBlockPos().getBlockNumber() == 40 && b.getCurrentPlayer().getJailCounter() == 3){
		  
	  this.sendOutOfJail();
		  
	  }*/
		  
	  //this.playerSelect = new PlayerSelectionUI(this.b.getCurrentPlayer());
  }
  
  public void displayHouseTokens(int selectedProperty){
	  
	  PropertyBlock tempProp = (PropertyBlock)this.block[selectedProperty];
	  
	  switch(tempProp.getCurrentNumberOfHouses()){
	  		case 0:
  				this.houseLbl[tempProp.getPropertyID()][4].setVisible(false);
  				this.houseLbl[tempProp.getPropertyID()][3].setVisible(false);
  				this.houseLbl[tempProp.getPropertyID()][2].setVisible(false);
  				this.houseLbl[tempProp.getPropertyID()][1].setVisible(false);
  				this.houseLbl[tempProp.getPropertyID()][0].setVisible(false);
  				break;
	  		case 1:
  				this.houseLbl[tempProp.getPropertyID()][4].setVisible(false);
  				this.houseLbl[tempProp.getPropertyID()][3].setVisible(false);
  				this.houseLbl[tempProp.getPropertyID()][2].setVisible(false);
  				this.houseLbl[tempProp.getPropertyID()][1].setVisible(false);
  				this.houseLbl[tempProp.getPropertyID()][0].setVisible(true);
  				break;
	  		case 2:
  				this.houseLbl[tempProp.getPropertyID()][4].setVisible(false);
  				this.houseLbl[tempProp.getPropertyID()][3].setVisible(false);
  				this.houseLbl[tempProp.getPropertyID()][2].setVisible(false);
  				this.houseLbl[tempProp.getPropertyID()][1].setVisible(true);
  				this.houseLbl[tempProp.getPropertyID()][0].setVisible(true);
  				break;
	  		case 3:
  				this.houseLbl[tempProp.getPropertyID()][4].setVisible(false);
  				this.houseLbl[tempProp.getPropertyID()][3].setVisible(false);
  				this.houseLbl[tempProp.getPropertyID()][2].setVisible(true);
  				this.houseLbl[tempProp.getPropertyID()][1].setVisible(true);
  				this.houseLbl[tempProp.getPropertyID()][0].setVisible(true);
  				break;
	  		case 4:
  				this.houseLbl[tempProp.getPropertyID()][4].setVisible(false);
  				this.houseLbl[tempProp.getPropertyID()][3].setVisible(true);
  				this.houseLbl[tempProp.getPropertyID()][2].setVisible(true);
  				this.houseLbl[tempProp.getPropertyID()][1].setVisible(true);
  				this.houseLbl[tempProp.getPropertyID()][0].setVisible(true);
  				break;
	  		case 5:
  				this.houseLbl[tempProp.getPropertyID()][4].setVisible(true);
  				this.houseLbl[tempProp.getPropertyID()][3].setVisible(false);
  				this.houseLbl[tempProp.getPropertyID()][2].setVisible(false);
  				this.houseLbl[tempProp.getPropertyID()][1].setVisible(false);
  				this.houseLbl[tempProp.getPropertyID()][0].setVisible(false);
  				break;
	  }
  }
  
  public void nextPlayer(){
	  
	  if(b.getCurrentPlayer().getDoubleRollCount() == 0){//net  
	  
		 if(this.b.getPlayerQueue()<this.b.getP().length-1){
			  b.setPlayerQueuePlusOne();
			  if(this.b.getCurrentPlayer().getActive()==false){
				  do{
					  this.b.setPlayerQueuePlusOne();
				  }while(this.b.getCurrentPlayer().getActive()==false && this.b.getPlayerQueue()<this.b.getP().length-1);
			  }
		  }else{
			  b.setPlayerQueueZero();
			  if(this.b.getCurrentPlayer().getActive()==false){
				  do{
					  this.b.setPlayerQueuePlusOne();
				  }while(this.b.getCurrentPlayer().getActive()==false && this.b.getPlayerQueue()<this.b.getP().length-1);
			  }
		  }
	  
	  } 
		  lastManStanding();
		 
		  if(this.lastManStanding==true && this.b.getP().length>1){
			  	String message = "You're the WINNAr! KONGRATUMALATIONS! Would you like to start a new game?";
			    String title = "You Win! Start Another game?";
			    
			    int reply = JOptionPane.showConfirmDialog(null, message, title, JOptionPane.YES_NO_OPTION);
			    new Sound().play("Sounds/win.wav");
			    if(reply == JOptionPane.YES_OPTION){
			    	ModeSelectionUI modeSelect = new ModeSelectionUI();
			    	modeSelect.setVisible(true);
			    	this.frame.setVisible(false);
			    }else{
			    	this.frame.dispose();
			    }
		  }else{
			 
			  this.playerSelect = new PlayerSelectionUI(this.b.getCurrentPlayer());			  
			  this.b.getCurrentPlayer().addObserver(playerSelect);
			  
		  }
}
  
  public boolean lastManStanding(){
	  int tempPlayersLeft=0;
	  
	  for(int i=0; i<this.b.getP().length; i++){
		  if(this.b.getP()[i].getActive()==true){
			  tempPlayersLeft++;
		  }
	  }
	  
	  if(tempPlayersLeft==1){
		  this.lastManStanding=true;
	  }
	  
	  return lastManStanding;
  }
  
  public void checkNextBlock(){
	  if(this.b.getCurrentPlayer().getCurrentBlockPos().getBlockNumber() + this.b.getCurrentPlayer().getLastRoll()>39){
		  this.b.getCurrentPlayer().setNextBlockPos(this.block[this.b.getCurrentPlayer().getCurrentBlockPos().getBlockNumber()+this.b.getCurrentPlayer().getLastRoll() - 39]);
	  }else{
		  this.b.getCurrentPlayer().setNextBlockPos(this.block[this.b.getCurrentPlayer().getCurrentBlockPos().getBlockNumber()+this.b.getCurrentPlayer().getLastRoll()]);
	  }
  }
  
  public void moveEvent(){
	  
	  checkNextBlock();	
	  
	  if(this.b.getCurrentPlayer().getDoubleRollCount()<3){
		  GearClass gc = new GearClass(this.b.getCurrentPlayer().getLastRoll());
		  gear = new Timer(500, gc);
		  
		  gear.start();
	  }else{
		  this.b.getCurrentPlayer().setDoubleRollCount(0);
		  this.moveCurrentPlayerToJail();
		  this.nextPlayer();
		  this.b.getCurrentPlayer().getPlayerName();
	  }
  }
  
  public void moveBackEvent(){ //counterpart of moveEvent()

		checkNextBlock();

		GoingBackGearClass  goingBackGC = new GoingBackGearClass(3); 
		goingBackGearTimer = new Timer(500, goingBackGC);
		  
		goingBackGearTimer.start();
	}

  
  public void moveCurrentPlayerToJail(){//bry
	  
	  label[b.getPlayerQueue()][b.getP()[b.getPlayerQueue()].getCurrentBlockPos().getBlockNumber()].setVisible(false);
	  b.getCurrentPlayer().setCurrentBlockPos(b.getBlkArray()[40]);
	  label[b.getPlayerQueue()][40].setVisible(true);
	  
  }
  
  public void displayBlock(){
	  
	  Block tmpPlayerBlock = this.b.getCurrentPlayer().getCurrentBlockPos();
	  
	  if(tmpPlayerBlock instanceof RailRoad){
		  RailRoad[] railRoad = new RailRoad[this.b.getRailRoadCount()];
		  
		  for(int i=0,j=0;i<this.block.length;i++){
				if(block[i] instanceof RailRoad){
					railRoad[j] = (RailRoad)block[i];
					j++;
				}
		  }
		  
		  RailRoadUI railroadUI = new RailRoadUI(this.b.getCurrentPlayer(),railRoad);
		  this.b.getCurrentPlayer().addObserver(railroadUI);
	  
	  }else if(tmpPlayerBlock instanceof Utilities){
		  Utilities[] utilities = new Utilities[this.b.getUtilityCount()];
		  
		  for(int i=0,j=0;i<this.block.length;i++){
				if(block[i] instanceof Utilities){
					utilities[j] = (Utilities)block[i];
					j++;
				}
		  }
		  	
		  UtilitiesUI utilitiesUI = new UtilitiesUI(this.b.getCurrentPlayer(),utilities);
		  this.b.getCurrentPlayer().addObserver(utilitiesUI);
	  }else if(tmpPlayerBlock instanceof Chance){
		  ChanceUI chanceUI = ChanceUI.getInstance(this.b.getCurrentPlayer(), this.b.getBlkArray(), this.b.getP());
		  chanceUI.drawCard();
		  chanceUI.setVisible(true);
	  }else if(tmpPlayerBlock instanceof CommunityChest){
		  CommunityChestUI communityUI = CommunityChestUI.getInstance(this.b.getCurrentPlayer(), this.b.getBlkArray(), this.b.getP());
		  communityUI.drawCard();
		  communityUI.setVisible(true);
	  }else if(tmpPlayerBlock instanceof Go){ //bry
		  GoUI goUI = new GoUI();//bry
	  }else if(tmpPlayerBlock instanceof JustVisiting){
	  
		  JustVisitingUI just = new JustVisitingUI();
	  
	  }else if(tmpPlayerBlock instanceof FreeParking){
		  FreeParkingUI freeParking = new FreeParkingUI();
	  }else if(tmpPlayerBlock instanceof Parak){//bry
		  GoToJailUI goToJailUI = new GoToJailUI();//bry
	  }else if(tmpPlayerBlock instanceof Tax){
			if(tmpPlayerBlock.getBlockNumber() == 4){
		
				TaxUI tax = new TaxUI((Tax) b.getBlkArray()[4],b.getCurrentPlayer(), "Sounds/willie.wav");
		
			}else if(tmpPlayerBlock.getBlockNumber() == 38){
		
				TaxUI tax = new TaxUI((Tax) b.getBlkArray()[38],b.getCurrentPlayer(), "Sounds/imelda.wav");
		
			}
	  }else{
		  PropertyBlock[] propertyBlock = new PropertyBlock[this.b.getPropertyCount()];
		  
		  for(int i=0,j=0;i<this.block.length;i++){
				if(block[i] instanceof PropertyBlock){
					propertyBlock[j] = (PropertyBlock)block[i];
					j++;
				}	
		  }
		  	
		  PropertyBlockUI propertyBlockUI = new PropertyBlockUI(this.b.getCurrentPlayer(),propertyBlock);
		  this.b.getCurrentPlayer().addObserver(propertyBlockUI);
	  }
  }
  
  public int getRailRoadCount(){
	  return this.b.getRailRoadCount();
  }
  
  public int getUtilitiesCount(){
	  return this.b.getUtilityCount();
  }
  
  public int getPropertyCount(){
	  return this.b.getPropertyCount();
  }
  
  public int activateBankruptcyChecker(){
	  int tempPlayerWorth = 0;
	  BankruptcyChecker bankrupt = new BankruptcyChecker(this.b.getCurrentPlayer(), this.b.getBlkArray());
	  tempPlayerWorth=bankrupt.checkPlayerWorth();
	  
	  return tempPlayerWorth;
  }
  
  public void activateTransferAssetsToPlayer(){
	  this.b.getCurrentPlayer().setActive(false);
	  this.label[this.b.getPlayerQueue()][this.b.getCurrentPlayer().getCurrentBlockPos().getBlockNumber()].setVisible(false);
	  BankruptcyChecker bankrupt = new BankruptcyChecker(this.b.getCurrentPlayer(), this.b.getBlkArray());
	  bankrupt.transferAssetsToPlayer();
	  this.nextPlayer();
	  }
  
  public void activateTransferAssetsToBank(){
	  this.b.getCurrentPlayer().setActive(false);
	  this.label[this.b.getPlayerQueue()][this.b.getCurrentPlayer().getCurrentBlockPos().getBlockNumber()].setVisible(false);
	  BankruptcyChecker bankrupt = new BankruptcyChecker(this.b.getCurrentPlayer(), this.b.getBlkArray());
	  bankrupt.transferAssetsToBank(this.b.getBlkArray(), this.b.getP(), this.b.getCurrentPlayer());
  }
  
  
  
private class GearClass implements ActionListener {
	  	
	  	int count = 0;
	  	Sound sound;
	  	
		public GearClass(int lmt){
			limit = lmt;
			this.sound = new Sound();//Sounds
			this.sound.playLoop("Sounds/walk.wav");
			saveButton.setEnabled(false);
		}
		
		@Override
		public void actionPerformed(ActionEvent gc){
			
			if(this.count<limit){
				
				if(b.getCurrentPlayer().getCurrentBlockPos().getBlockNumber()==39 && b.getCurrentPlayer().getNextBlockPos().getBlockNumber()!=39) {
					
					b.getCurrentPlayer().setCurrentBlockPos(block[0]);
				
					label[b.getPlayerQueue()][39].setVisible(false);
					b.passGo();
				}
				
				/**This part adds 1**/
				
				else{
					b.getCurrentPlayer().setCurrentBlockPos(block[b.getCurrentPlayer().getCurrentBlockPos().getBlockNumber()+1]);
				}
				
				movePlayerToken(b.getPlayerQueue(), b.getCurrentPlayer().getCurrentBlockPos().getBlockNumber());
				
				System.out.println("End of Round -  label["+b.getPlayerQueue()+"]["+b.getCurrentPlayer().getCurrentBlockPos().getBlockNumber()+"]");
				this.count++;
				
			}
			else{
				gear.stop();
				displayBlock();
				this.sound.getClip().stop();//Sounds
				saveButton.setEnabled(true);
				}	
			}		
		}

private class GoingBackGearClass implements ActionListener{ //counter part of GearClass -pwede ganito muna? next time ko na isipin ung isang class lang. 

	int count = 0;
	private int limit;
	Sound sound;

	public GoingBackGearClass(int lmt){
		this.limit = lmt;
		this.sound = new Sound();//Sounds
		this.sound.playLoop("Sounds/walk.wav");
		saveButton.setEnabled(false);
	}

	@Override
	public void actionPerformed(ActionEvent goingBackGC){

		if(this.count<limit){

			if(b.getCurrentPlayer().getCurrentBlockPos().getBlockNumber()==39 && b.getCurrentPlayer().getNextBlockPos().getBlockNumber()!=39) {
					
					b.getCurrentPlayer().setCurrentBlockPos(block[0]);
				
					label[b.getPlayerQueue()][39].setVisible(false);
					b.passGo();
			} else{
				b.getCurrentPlayer().setCurrentBlockPos(block[b.getCurrentPlayer().getCurrentBlockPos().getBlockNumber()-1]);
	
			
				movePlayerTokenBackwards(b.getPlayerQueue(), b.getCurrentPlayer().getCurrentBlockPos().getBlockNumber());
				
				System.out.println("End of Round -  label["+b.getPlayerQueue()+"]["+b.getCurrentPlayer().getCurrentBlockPos().getBlockNumber()+"]");
				this.count++;
			}

		} else{
			goingBackGearTimer.stop();
			displayBlock();
			this.sound.getClip().stop();//Sounds
			saveButton.setEnabled(true);
		}

	}
}

public String getSaveData() {
		
		String data = null;
		Player playerContainer = null;
		Block blockContainer = null;
		String delimiter = "<>";
		data = "NumberOfPlayers"+delimiter+this.b.getP().length+delimiter+"\n"; //delimiter as delimiter
		//System.out.println(data);
		
		for(int counter = 0 ; counter<b.getP().length; counter++){ //this for is for the player array
			playerContainer = b.getP()[counter];
			data=data+"Player"+delimiter;
			data = data+playerContainer.getPlayerName()+delimiter; //String
			data = data+playerContainer.getCurrentMoney()+delimiter+playerContainer.getLastRoll()+delimiter+playerContainer.getDoubleRollCount()+
					delimiter+playerContainer.getChanceJailToken()+delimiter+playerContainer.getCommunityJailToken()+delimiter+playerContainer.getHighRoll()+delimiter+playerContainer.getQueueSpot()+
					delimiter+playerContainer.getComponentPointer()+delimiter+playerContainer.getJailCounter()+delimiter; //ints
			if(playerContainer.getCurrentBlockPos() == null && playerContainer.getNextBlockPos() == null){
				
				data = data+"0"+delimiter+"0"+delimiter; // int used for pointers for blocks
				
			}
			else{
				
				data = data+playerContainer.getCurrentBlockPos().getBlockNumber()+delimiter+playerContainer.getCurrentBlockPos().getBlockNumber()+delimiter; // int used for pointers for blocks *questionable
				//data = data+player.getCurrentBlockPos().getBlockNumber()+"delimiter0delimiter"; // int used for pointers for blocks
				
			}
			data = data+playerContainer.getActive()+delimiter;
			data = data+playerContainer.getPlayerToken()+delimiter+"\n";
			
		}
		
		
		
		for(int counter = 0; counter<b.getP().length; counter++ ){ //int for pointer for the current player
			
			if(b.getP()[counter] == b.getCurrentPlayer())
				data = data+"ElementOfCurrentPlayer"+delimiter+counter+delimiter+"\n";
			
		}
		
		for(int counter = 0; counter<b.getBlkArray().length; counter++){
			blockContainer = b.getBlkArray()[counter];
			
			
			if(blockContainer instanceof RailRoad){
				//flag
				data=data+"Block"+delimiter;
				data=data+"RailRoad"+delimiter;
				
				//block variables
				data=data+blockContainer.getBlockNumber()+delimiter;
				
				//RailRoad variables
				
				if(((RailRoad) blockContainer).getCOwner() != null){ //traverse to all player and write when owner is found
					
					for(int innerCounter = 0; innerCounter<b.getP().length; innerCounter++){
						
						if(((RailRoad) blockContainer).getCOwner().equals(b.getP()[innerCounter])){
							
							data = data+innerCounter+delimiter;
							
						}
						
					}
				
				}else{data = data+"null"+delimiter;} //comes in if no owner
				
				data=data+((RailRoad) blockContainer).getIsMortgaged()+delimiter+"\n";
				
			}else if(blockContainer instanceof Utilities){
				//flag
				data=data+"Block"+delimiter;
				data=data+"Utilities"+delimiter;
				
				//block variables
				data=data+blockContainer.getBlockNumber()+delimiter;
				
				//Utilities variables
			
				if(((Utilities) blockContainer).getCOwner() != null){ //traverse to all player and write when owner is found
					
					for(int innerCounter = 0; innerCounter<b.getP().length; innerCounter++){
						
						if(((Utilities) blockContainer).getCOwner() == b.getP()[innerCounter]){
						
							data = data+innerCounter+delimiter;
							
						}
						
					}
				
				}else{data = data+"null"+delimiter;} //comes in if no owner
				
				data=data+((Utilities) blockContainer).getIsMortgaged()+delimiter+"\n";
				
			}else if(blockContainer instanceof PropertyBlock){
				
				//flag
				data=data+"Block"+delimiter;
				data=data+"PropertyBlock"+delimiter;
				
				//block variables
				data=data+blockContainer.getBlockNumber()+delimiter;
				
				//PropertyBlock variables
				
				data=data+((PropertyBlock) blockContainer).getCurrentNumberOfHouses()+delimiter;
				
				if(((PropertyBlock) blockContainer).getCOwner() != null){ //traverse to all player and write when owner is found
					
					for(int innerCounter = 0; innerCounter<b.getP().length; innerCounter++){
						
						if(((PropertyBlock) blockContainer).getCOwner() == b.getP()[innerCounter]){
						
							data = data+innerCounter+delimiter;
							
						}
						
					}
				
				}else{data = data+"null"+delimiter;} //comes in if no owner
				
				data=data+((PropertyBlock) blockContainer).getIsMortgaged()+delimiter+"\n";
				
			}
			
			
		}
	
		System.out.println("\n\n");
		System.out.println(data);
		return data;
		
	}
}


class ImagePanel extends JPanel {

	  private Image img;
	
	  public ImagePanel(String img) {
	    this(new ImageIcon(img).getImage());
	  }
	
	  public ImagePanel(Image img) {
	    this.img = img;
	    Dimension size = new Dimension(img.getWidth(null), img.getHeight(null));
	    setPreferredSize(size);
	    setMinimumSize(size);
	    setMaximumSize(size);
	    setSize(size);
	    setLayout(null);
	  }
	
	  @Override
	public void paintComponent(Graphics g) {
	    g.drawImage(img, 0, 0, null);
	  }
}

